Refresh Combo

P

Pete

I have a Command Button on my TabCtrl Sub form that opens
a form so I can add another item, how do I open the form
in "Add" mode.

stDocName = "frmVenue"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Once I have added this item, I wish to be able
to "Refresh" the Combo/Sub Form that the new Item will
appear in, at the moment I have to close down the main
form, and reopen it which negates the use of the Command
button

thanks

Pete
 
A

Allen Browne

Use the AfterUpdate event procedure for the form where you added the new
record to Requery the combo on the original form.

Something like this:

Private Sub Form_AfterUpdate()
Forms![Form1]![Combo1].Requery
End Sub
 
P

Pete

Thanks Allen
-----Original Message-----
Use the AfterUpdate event procedure for the form where you added the new
record to Requery the combo on the original form.

Something like this:

Private Sub Form_AfterUpdate()
Forms![Form1]![Combo1].Requery
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I have a Command Button on my TabCtrl Sub form that opens
a form so I can add another item, how do I open the form
in "Add" mode.

stDocName = "frmVenue"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Once I have added this item, I wish to be able
to "Refresh" the Combo/Sub Form that the new Item will
appear in, at the moment I have to close down the main
form, and reopen it which negates the use of the Command
button

thanks

Pete


.
 
Top