Requery problem when exiting macro

dkaib

New member
Local time
Today, 16:48
Joined
Jun 7, 2003
Messages
9
I have a macro setup on On Double Click in a subform on a tab control to a Combo Box called Services to allow the user to add records if a Service is not included in the Combo Box.

Combo Box on the subform is setup as follows:

Name-strAlumniServiceID
Control Source-strAlumniServiceID
Row Source Type-Table/Query
Row Source-qryServices

The macro contains the following:

Echo No
OpenForm frmServices
Requery strServiceName

When the macro executes you can add records to the Services file and change the description names of the Services.

If you add a Service when the form is first opened, the added Service is displayed in the Combo Box.
If you execute the macro a second time and add another Service the added service is not displayed in the Combo Box.
If you execute the macro a third time and change the description of an existing service the change is displayed in the Combo Box but the 2nd added Service is still not displayed.

It looks like the requery is not functioning properly.

The only way to get the additional records to display is to use Records -> Refresh.

Any suggestions are greatly appreciated.

Thanks in advance,
Dan
 
You may be requerying the combobox at the wrong point.
Within the 'On enter' event of your combobox put the code:

Forms!frmMainformName!frmSubFormName!ComboBoxName.Requery
 
Thanks for your reply Dan,

I put the following code in the On Enter event and it did not make a difference:

Forms!frmAlumni!fsubAlumniCommittees!strAlumniCommittee.Requery

Thanks again,
Dan
 

Users who are viewing this thread

Back
Top Bottom