UtterAccess.com
We have detected that you are using an unsupported web browser. We recommend you to upgrade your web browser to get the most from UtterAccess forums.
Why should and how can I upgrade?
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Subform Not Showing Data From The Main Form, Access 2010    
 
   
swarm6
post Apr 25 2013, 05:54 PM
Post #1

UtterAccess Member
Posts: 38



Hi All -
I am using Access 2010. I have a Main Form for entering data (bound to the table). I have a subform on the main form linked to 2 fields on the main form. When the Main Form is in Data Entry mode, the subform will not populate, but when the Main Form is DataEntry = no, the Sub Form populates correctly. Is there some way I can have the Main Form be Data Entry, but the SubForm show data after the fields in the Main Form are filled in?
Thank you in advance for your help.
Go to the top of the page
 
+
theDBguy
post Apr 25 2013, 06:17 PM
Post #2

Access Wiki and Forums Moderator
Posts: 58,453
From: SoCal, USA



Hi,
welcome2UA.gif
Not sure I understand what you're trying to do. Data Entry is used for adding new records, which means there won't be any subform records yet.
Just my 2 cents...
Go to the top of the page
 
+
Jeff B.
post Apr 25 2013, 06:23 PM
Post #3

UtterAccess VIP
Posts: 8,728
From: Pacific NorthWet



The Access main form/subform construction is designed to help with data entry when the underlying data is related one-to-many. The "one" side data (think "Order") is displayed in the main form. The "many" side data (think "items ordered") is displayed in the subform.
It sounds like this is NOT how you're trying to use the design.
Please describe your data...
Go to the top of the page
 
+
swarm6
post Apr 25 2013, 06:48 PM
Post #4

UtterAccess Member
Posts: 38



Jeff - I do believe it is similar to what you are describing. This is a non/profit donor situation.
For Example: The fund raiser is a golf tourney. There can be multiple deposits attributed to this person for this event. The person also has a role (participant, sponsor, etc., but just one role per event.) The main form is for entering deposits. The subform is for entering/displaying the roles.
So when you enter the person and this particular event for the 1st time, there is no role displayed (is null), and it can be entered in the subform; however, on subsequent deposits, it would be great for the user to see the role already entered for this person/golf tourney, or they will get an error if they try to put another role in for this contact/golf event combination.
The deposits are on tblDeposit
The roles are on tblRoleData
Go to the top of the page
 
+
swarm6
post Apr 25 2013, 06:50 PM
Post #5

UtterAccess Member
Posts: 38



Thanks, DBGuy...
But even when you are entering new information, it is nice to be able to view related info. Like maybe what was ordered last time? Or a history of orders even if the current order has not been entered. Does that make sense?
Go to the top of the page
 
+
swarm6
post Apr 26 2013, 06:09 AM
Post #6

UtterAccess Member
Posts: 38



I worked on it this morning and when I click refresh the data does show up in my subform. So perhaps I need to add some requery code? Not sure how to do this, and I don't understand VB very well. Can someone help?
Thanks!
Go to the top of the page
 
+
swarm6
post Apr 26 2013, 06:37 AM
Post #7

UtterAccess Member
Posts: 38



Solved! I changed fetch defaults to NO and all is working correctly.
Go to the top of the page
 
+
swarm6
post Apr 26 2013, 07:02 AM
Post #8

UtterAccess Member
Posts: 38



Well, almost...
Go to the top of the page
 
+
Jeff B.
post Apr 26 2013, 07:56 AM
Post #9

UtterAccess VIP
Posts: 8,728
From: Pacific NorthWet



Hmmm, "deposits" ... that's a plural. How can a main form hold multiple deposits? Please post a description of the underlying data. It all starts with the data.
Go to the top of the page
 
+
swarm6
post Apr 26 2013, 07:42 PM
Post #10

UtterAccess Member
Posts: 38



One line in the tblRoleData has:
ID - autonumber
ContactID
RoleID number (connects to a list of role names)
eventID number (connects to a list of events)
There can only be one combination of ContactID, EventID, and Role (sponsor, participant, etc)
Deposits is your usual - :
depositId
depositDate
Amount
type (ck, etc)
eventID
This connects to the Role ID on 2 items : contactID and EventID
There can be many deposits with the same contactID and EventID
Go to the top of the page
 
+
swarm6
post Apr 26 2013, 07:46 PM
Post #11

UtterAccess Member
Posts: 38



New info:
I have the option of putting in defaults for the data entry via text boxes at the top to make data entry easier for my user. I was testing the default values:
When there was a default value in the EventId, and I entered a contact in the form, the subForm read immediately. It has something to do with being able to "see" both the event and the contactID.
Go to the top of the page
 
+
swarm6
post Apr 26 2013, 08:34 PM
Post #12

UtterAccess Member
Posts: 38



Now I have it so that the subform populates when I have entered both the ContactId and the EventId on the Main Form.
ew problem:
On open, the property of the subform = locked, and enabled = no so the user could not click in the subform and inadvertently save the data in the main form... I have a button that sets the enable property of the subform = yes and the lock = no. Now you can see the contents of the drop box when you click on them in the subform, but you cannot edit the contents even though edit=yes.
Go to the top of the page
 
+
swarm6
post Apr 26 2013, 09:09 PM
Post #13

UtterAccess Member
Posts: 38



I set the property of the main form to edit = yes, so now I can edit in the subform
Thanks for help and interest.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Search  ·  Go to Top  ·  Lo-Fi Version Time is now: 25th October 2014 - 12:31 AM