|
-
Dec 9th, 2008, 03:22 PM
#1
Thread Starter
New Member
Text Fields on Form to Parameters in Query
Hello,
I'm just learning (slowly), and am having trouble with the following.
I've got a query in MS Access (2003) with parameters of "city", "startDate" and "endDate". These are fixed so when you open the query, the parameter windows pop up for you to fill in.
I am trying to create a form where a user can fill in the above information, click the button and have the user defined text fields take the place of those parameter windows above. (Or have them collect the info from the form and not pop up.)
Also, I would like for a field of the query result to show in a separate text box on the form once complete. (This would be a percentage that I would need a format change from the query result.)
Thanks in advance for your assistance!
Last edited by K8Shrew; Dec 9th, 2008 at 04:24 PM.
-
Dec 9th, 2008, 06:21 PM
#2
Re: Text Fields on Form to Parameters in Query
Welcome to the forums!
You will need to use a Command object. Have a look at this, included is using a query to add a record, you can modify it to suit your need.
-
Dec 10th, 2008, 11:28 AM
#3
Thread Starter
New Member
Re: Text Fields on Form to Parameters in Query
Thanks for the reply!
I actually was able to fix it with some simple steps! To fill in the parameter prompts, I did the following:
DoCmd.OpenQuery "qryNPSbyCity"
[City] = Me.City
[StartDate] = Me.StartDate
[EndDate] = Me.EndDate
and to fill in the value from the query to the form, I used:
Me.NPS.Value = DLookup("NPS", "qryNPSbyCity")
Then I added:
DoCmd.Close acQuery, "qryNPSbyCity"
to remove the open query from the screen.
Pretty exciting!
-
Dec 10th, 2008, 11:33 AM
#4
Re: Text Fields on Form to Parameters in Query
If your problem has been solved then you can now mark your thread as resolved using the Thread Tools menu.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|