Set Forms Recordsource

DBL

Registered User.
Local time
Today, 14:32
Joined
Feb 20, 2002
Messages
659
Is there a way to set the recordsource for a form before it opens? I've got Me.recordsource = "QryNewCaseForm" on the On Open event of the form but I toggle between recordsources once the form is open and if I close it while the recordsource is "QryCaseForm" it won't open as "qryNewCaseForm" the next time I open it.
 
When you open a form based on an underlying query, Microsoft Access runs the underlying query for the form before it runs the Open macro or event procedure.

Have you tried putting the code in the 'On Load Event' instead.
 
Unfortunately that didn't work. What I've managed to do is re-set the record source as the form is closing so that's it's set for the next time it opens.

There's always a way round a situation!
 

Users who are viewing this thread

Back
Top Bottom