Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2013-01-13
2
352 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 30

Expert Comment

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

Forms!nameOfForm!nameOfFieldOnForm
0
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
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…

791 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