Setting RecordSource on load

Jerry8989

Registered User.
Local time
Yesterday, 19:55
Joined
Mar 16, 2006
Messages
64
I have a form that I want to set the recordsource to a query with a parameter passed into it. The parameter is derived on the onload of the form but i'm not sure how to set the forms recordsource to the query and the parameter?

What i'm doing is taking the users windows login username and running it against my user table. From there I pull the id for that user. I need to use the id as my parameter for the form that shows up when the user opens up the access front end.

Thank You
 
The parameter is derived on the onload of the form
Can you explain this part a little bit more? I'm kind of confused as to what you mean. It sounds like you are getting the information from the same form you want to have the recordsource changes on and that sounds a little funky.
 
Bob,

I just figured it out. My function that I call onload of the form was checking to see if the user who is trying to open the db has the rights too view the info. If he does then I want to fill the start up form with his specific data. I changed my function to return back the windows username and then I create a sql string and just set me.recordsource = to the dynamic sql string I create.

Thank you for helping.
 

Users who are viewing this thread

Back
Top Bottom