refresh ? (1 Viewer)

RpbertS

Registered User.
Local time
Today, 01:59
Joined
Feb 14, 2000
Messages
93
Hi I have a form wiht a dropdown and when you want to add something tothat dropdown you switch to another form save the info. to the table and exit back to the original form, I included a refresh button on the original form but my manager would prefer this automated. I have added this code

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

in a few of the event procedures but it is not working is there another way I should approach this?

thanks for the time,
Rpb


[This message has been edited by RpbertS (edited 04-24-2000).]

[This message has been edited by RpbertS (edited 04-24-2000).]
 

Carol

Registered User.
Local time
Today, 01:59
Joined
Jan 15, 2000
Messages
280
Put this code as an Event Procedure behind your drop down in your main form on the On Enter in the properties:

Private Sub MainFormFieldName_Enter()
On Error GoTo MainFormFieldName_Enter_Err

DoCmd.Requery "Table/QueryName"


MainFormFieldName_Enter_Exit:
Exit Sub

MainFormFieldName_Enter_Err:
MsgBox Error$
Resume MainFormFieldName_Enter_Exit

End Sub

This will requery your underlying source for your dropdown box as soon as you enter it. You will have to change the names that I used. I used MainFormFieldName for the name of your dropdown box and I used Table/QueryName for the recordsource of this box.

Good Luck.
 

Users who are viewing this thread

Top Bottom