Need Help with specifying criteria with a text box

CCIDBMNG

Registered User.
Local time
Today, 13:12
Joined
Jan 25, 2002
Messages
154
I think the answer to this question is probably somewhere on this forum but not for exactly what I need. I have tables for each data-entry person. All the tables are basically the same. I want to be able to fill a combo box for a county based off of what the data-entry person typed as the city. I know how to do this with one form but I don't want to create specific queries for each data-entry form I'm having a problem. Is there a way to put in the criteria of a query the name of the form that is currently open? Or is there another way to do it using code in my forms? Someone please help.
 
the easiest way to do it would be to create a stored procedure that does the query and apply the result to the current form

prob is I couldnt tell ya off top of my head how to do it with access LOL

but i would try looking up stored procedures in help
or a macro would prob work too

hope that least gets ya on right track
smile.gif


al0y0u
 
actually you might look at another thread i just replyed in that code might apply to you also its simple and fast it would have to be done in each form but wouldnt take but a minute per form

Wrap your brain around this one is name of thread
 
Thanks but I figured it out. When they tab out of the city text box I have code that sets the row source of the combo box with a SQL statement based off of the city text box. Now that I have that figured out does anyone know how to set the default value of a combo box to the an item in the combo boxes list?
 
Why do you have separate tables for each user? Put the username as a field in the table and sift by that if you need to give each user different data.

DoCmd.OpenForm "FormName",,,"[UserNameField] = '" & fOSUserName() & "'"

HTH,
David R
 

Users who are viewing this thread

Back
Top Bottom