Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

source of unbound form based on a 'current user' qry - can I change?

Status
Not open for further replies.

jsanbor1

MIS
Apr 30, 2003
38
US
PaulF helped me with this bit of code..

Me.RecordSource = "qry" & Environ("username")

it works great. Actually I changed it to -> "qry" & Current User.

Anyway, How can I change the recordsource of the form to another query with a function? I think if I had a function that would do that, I could call it from a macro and put it on a custom menu.



 
or even if I could filter it down

"qry" & Current User
where IDStatus = "1 Full CLient"

is this possible to do with a function?
 
jsanbor1,

You can change the record source with something like

Me.RecordSource = "yournewsouce"

Or from outside the form

Forms![yourformname].RecordSource = "yournewsouce"

Thanks

MOrdja

 
ok thanks.

I guess that leads me to another question along the lines of the "qry" & Current User...

How can I use that for a listbox record source? If I put -> "qry" & Current User as the record source for the list box, I get an error

that would make my life 400% better.

sorry for being such a newb.

jj

 
In the Load event procedure of the form you may add this code:
Me![listbox name].RowSource = "qry" & CurrentUser

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top