Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Do I need a requery?

Status
Not open for further replies.

freebd99

IS-IT--Management
Aug 6, 2002
30
US
Hi all,
I have 4 subforms running under tabs. The main tab/subform is participant. Tab 2 is the registration form. All the underlying tables are linked by the participant ID.

What happends when a new participant is entered is that when I click on the registration tab the form does not update the Participant ID under registration. I have to first save the new participant close it then open it again to enter registration information for that participant.

I would really appreciate anyone's help or suggestions.
 
One Suggestion is to do the following.

Update the Participant After_Update event, see below



Private Sub ParticipantId_AfterUpdate()
Me.Requery
End Sub



If everything (i.e. all the subforms key off the participantId, then after a new participant is entered, you either have to hit your enter key, and have the Form Requeried, or use a command button that when clicked will Requery the Main Form.

A lot depends on how the subforms relate to the main form, and where the New Participant is entered, if all the controls are on sub forms, you may have to requery all the sub forms. I'm Your Huckleberry!
 
I tried that and as soon as I enter the participant ID on the main subform (Participant) it goes away once I hit the enter key to enter other information.

Let me explain again. I have the main form Particpant with subforms/tabs. When a new person is entered I want to after entering their contact information (participant form)that I can they click on the registration tab and enter the registration for that person.

What keeps happening is that when a new person is created their participant ID doesn't show up in the other tabs unless I close the form and open it up again.

Thanks,
Anna
 
Try this command

DoCmd.RunCommand acCmdSave

David I'm Your Huckleberry!
 
I hope this is not a stupid question but where does that code go.

Thanks,
Anna
 
Anna, you know that there are no stupid questions, only stupid answers!

Put it in the Participant after update.
Then in the same place add
Me.Requery
David I'm Your Huckleberry!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top