Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Pass a parameter from a form to a query and run a report

Posted on 2013-01-13
2
Medium Priority
?
358 Views
Last Modified: 2013-01-17
I am passing a parament name from a form to a query.  Below is my sql

SELECT [kwahudb_thru 0312partly].ID, [kwahudb_thru 0312partly].Date, [kwahudb_thru 0312partly].NAME_, [kwahudb_thru 0312partly].RECEIPT_Num, [kwahudb_thru 0312partly].[DEVELOPMENt fee], [kwahudb_thru 0312partly].REGISTRATI, [kwahudb_thru 0312partly].EASTER, [kwahudb_thru 0312partly].OTHER, [kwahudb_thru 0312partly].YR
FROM [kwahudb_thru 0312partly]
WHERE ((([kwahudb_thru 0312partly].NAME_)=[Forms]![FormquryName].[txtEnterNameHere]));

Its not working, what am I doing wtong?  It runs OK but no data shows on the report.

Thanks
0
Comment
Question by:Kdankwah
2 Comments
 
LVL 31

Expert Comment

by:hnasr
ID: 38772082
In the criteria box enter:

Forms!nameOfForm!nameOfFieldOnForm
0
 
LVL 49

Accepted Solution

by:
Dale Fye earned 2000 total points
ID: 38772388
1.  Start out by removing the WHERE clause, does the report work then?  If not, then you have a larger problem than the WHERE clause.

2.  In your WHERE clause, start out by trying:

WHERE [kwahudb_thru 0312partly].[NAME_])=[Enter Name!]

and see whether that works.  It should popup a message "Enter Name" when you run the report.  If you enter a valid name then it should work.

3. Make sure that the name of the forms data control is exactly the way you have it written on:

WHERE [kwahudb_thru 0312partly].[NAME_]=[Forms]![FormquryName].[txtEnterNameHere]

It looks like the Form name 'FormquryName' should probably be replaced with the actual name of your form.  Although that could be the name of your form, it looks like it may be misspelled.
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question