dual recordsource for form

G

Guest

What is the proper way to change the recordsource of a form when it is open
from two different sources?

Right now, I am passing openargs to the form's load event
but I think that's probably too late.

the calling form command goes something like this:
docmd.OpenForm "frmComplaints",,,strSQL,,,,"Unresolved"

vs

docmd.OpenForm "frmComplaints",,,,,,,,"Normal"

Definitely, if I reopen the form in the load event, I have no way of knowing
what a variable strSQL filter will be.

The only example I have of changing the recordsource was from a KeyDown
event where the source was changed while currently IN a form.
since it worked, I didn't stop to consider if there was a more proper way of
doing it - for -say - if you had to open the form from another source.
 
R

Rick Brandt

jonefer said:
What is the proper way to change the recordsource of a form when it is open
from two different sources?

Right now, I am passing openargs to the form's load event
but I think that's probably too late.

Use the Open event. It's one step before Load.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top