You can't directly pass a variable to a query object. But there are two other options for you:
1) Pass the variable to a hidden control on a form that will remain open (even in hidden mode), and use that field as the parameter for your query. 2) Don't use a saved query, but rather create your query on-the-fly in code. You can then use your variable in this query. The simpler one to use is option 1, especially if your query is a complicated one. Hope that helps. Eric > -----Original Message----- > From: [email protected] > [mailto:[EMAIL PROTECTED] On Behalf Of eliotchs > Sent: Thursday, June 16, 2005 7:12 AM > To: [email protected] > Subject: [AccessDevelopers] ?? on using string variable in a query?? > > Hi, > > Does anyone know how I can use a VB variable in a query? > > here is my example > User logs in > user chooses form to open, depending on username I want to > assign a location code (strLocation) then pass that location > code on to a query parameter > > Thanks > Joe > > > > > > > > > Please zip all files prior to uploading to Files section. > Yahoo! Groups Links > > > > > > > Please zip all files prior to uploading to Files section. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AccessDevelopers/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
