Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query not picking up form dat

Status
Not open for further replies.

mikeba1

Programmer
Joined
Jan 2, 2005
Messages
235
Location
GB
the following query is not working properly

SELECT RoomBookings.Patient, RoomBookings.Therapist, RoomBookings.Appdate, [Forms]![frmreportga]![fd] AS fd, [Forms]![frmreportga]![td] AS td, 1 AS noof, RoomBookings.TimeFrom, RoomBookings.TimeTo, [Forms]![frmreportga]![ddon] AS roomdon
FROM RoomBookings
WHERE (((RoomBookings.Patient)=[Forms]![frmreportga]![memkey]) AND ((RoomBookings.Appdate) Between [Forms]![frmreportga]![fd] And [Forms]![frmreportga]![td]))
ORDER BY RoomBookings.Appdate;

the fields fd , td and ddo are not displayed from the form
HOWEVER the fields fd and td are dates and are used in the where section and they do work properly.
Why do they work in the where section but are not displayed

thanks
 
Yes I want to pass data from the form into the query

Running the query the values are not displayed in the query and underlying report
 
What about:
Code:
SELECT RoomBookings.Patient, RoomBookings.Therapist, RoomBookings.Appdate, [Forms]![frmreportga]![fd][b].value[/b] AS fd, [Forms]![frmreportga]![td][b].value[/b] ...

Are [td] and [fd] text fields?
(What you have works just fine in my test database either with or without the .value when I'm using a text box.) (Access 2003 using Access 2000 format).

Greg
People demand freedom of speech as a compensation for the freedom of thought which they seldom use. Kierkegaard
 
Ignore earlier comment.
When working with dates in calculated fields, use (tested):
Code:
..., RoomBookings.Appdate, [red][b]DateValue([/b][/red][Forms]![frmreportga]![fd][red][b])[/b][/red] AS fd, ...



Greg
People demand freedom of speech as a compensation for the freedom of thought which they seldom use. Kierkegaard
 
Thanks everyone.
DateValue works fine.
The form is closed when the report is closed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top