benracer
Nov 27 2008, 04:54 PM
Hello,
I have a table that contains various coumns, this is named Members.
I also have a query that that works when run using the standard parameter 'pop up', this is named mainquery.
I have created a form with a text box names qid1, i would like to pass the data entered here into the query (mainquery).
I have tried to use the folloing code allthough nothing happerns when the field loses focus....
Private Sub qid1_LostFocus()
DoCmd.OpenQuery "mainquery", acViewNormal, acEdit
End Sub
Many Thanks,
Ben
DougY
Nov 27 2008, 05:07 PM
Welcome to Utter Access Forums!
What you are looking for is called Query by Form (QBF).
Check out
this Microsoft KB article on the subject.
theDBguy
Nov 27 2008, 05:07 PM
Welcome to Utter Access!
If I understand your question correctly, change the popup parameter in your query from something like:
[Enter ID]
to
Forms!NameOfYourForm.qid1
Hope that helps...
benracer
Nov 27 2008, 05:20 PM
Thanks for your replies - and the warm welcome!
I have read through the the kb page and i have found the difference in my script.
They use the macro method of opening the query from the form, is there a way to do this in VB?
I have found this informaton...
http://msdn.microsoft.com/en-us/library/bb238028.aspx
However nothing happerns when the button is clicked.
Regards,
Ben
Edited by: benracer on Thu Nov 27 17:22:54 EST 2008.
theDBguy
Nov 27 2008, 06:25 PM
You might want to post a small copy of your db with test data (and also an Acc2003 version), if you can, to help us understand what you're going through.