Subform Question

belsha

Registered User.
Local time
Today, 13:40
Joined
Jul 5, 2002
Messages
115
In Access 97, I have a tab control with a subform on it. You enter demographics info, then jump over to the subgform (on the same tab page) and enter more specific info about that person. The parent child relationship is set up correctly. I have a drop-down list for the person to choose the ID number from the demographics to link the two. However, I can't get that number to show in my list unless I close the whole form and reopen it. I have tried a save button, (no dice), refresh (takes me out of Access!). How can I get that initial info to update so I can just tab over to the subform and choose the number from the combo box? Thanks!
 
You need to requery the ComboBox. I would use the AfterInsert event of the SubForm. This is the first point where you know you have a new record.
 
Tried that, no change. Any other suggestions?
 
Got it, not pretty but it works. Put a close and open macro on the main form, and then used the requery and it works. Thanks.
 
Belsha,

That sounds awful crude and abrupt. Could you strip out any sensitive data and Compact and Repair and zip up what is left and post it? I'm certain there is a more graceful method to accomplish what you desire.

Refresh should *not* take you out of Access. You may want to perform the tasks described here: http://allenbrowne.com/ser-47.html
 
Thanks, but can't email any databases in any form from here. Will go thru what you recommended though, I'm not really satisfied with the outcome as yet either.
 
Perhaps a more complete description of your situation might work. You stated:
The parent child relationship is set up correctly. I have a drop-down list for the person to choose the ID number from the demographics to link the two.
Is the cbo on the main form? I answered the first time thinking the cbo was on the SubForm.
 

Users who are viewing this thread

Back
Top Bottom