PDA

View Full Version : Passing 2 parameter values from forms to query



sindhuja
10-17-2008, 05:06 PM
Hi All,

Need an help ..!

Designed a form named frmdate from where i need to select the date range to generate reports.

Have two textbox txtstartdate and txtenddate and a calendar ctrl named cal1 an option button.

i have selected option button, the calendar value will be displayed in the corresponding text box based on the option box selection.

Now depending upon the date range in the two textbox i need to generate the report. The two text box values will be the parameter to the query.

Query :
select * from tblfeeds where DateofEntry Between [forms]![frmdate]![txtstartdate] and [forms]![frmdate]![txtenddate]

If i run this query it works. But i run the query via forms its not working for me... am not sure how to assign the textbox values from forms to the query.

Excepting help regarding this...
Also attached sample database for the reference.

-Sindhuja

Demosthine
10-17-2008, 10:05 PM
Evening There.

The first two errors I notice is that your Table Name in your Query does not match your actual Table Name and your Form Name in your Query does not match your actual Form Name. Fix these errors and you'll be better off...

But in regards to your actual question, check out this article on the Microsoft Office (http://office.microsoft.com/en-us/access/HA011170771033.aspx?pid=CL100570041033) website. It should answer most of your Form Query questions.

Happy Coding.
Scott

Demosthine
10-17-2008, 10:05 PM
Evening There.

The first two errors I notice is that your Table Name in your Query does not match your actual Table Name and your Form Name in your Query does not match your actual Form Name. Fix these errors and you'll be better off...

But in regards to your actual question, check out this article on the Microsoft Office (http://office.microsoft.com/en-us/access/HA011170771033.aspx?pid=CL100570041033) website. It should answer most of your Form Query questions.

Happy Coding.
Scott