How to query an unbound text box?

andy_dyer

Registered User.
Local time
Today, 19:04
Joined
Jul 2, 2003
Messages
806
Hi,

I am trying to get the contents of a text box (which is not bound to any field in any table) to appear in a query?

The nuts and bolts are;

I have a form which has a start date box and an end date box the entries in these boxes provide the links for all of my reports and my existing queries ceheck these boxes for their start and end dates.

I would like within these queries to also pull through the actual dates in the boxes as well.

The code I am using in my query at present is;

=[Forms]![frmReportDates]![txtStartDate]

Which isn't working, so any suggestions would be fantastic!!

Thanks

Andy
 
Hi Bert,

I don't understand...
:confused:

My criteria is [Forms]![frmReportDates]![txtStartDate] (as the = disapeers on saving)

I don't get any errors but all I get is blank return on my query.

Thanks

Andy
 
Try:

DateValue([Forms]![frmReportDates]![txtStartDate])
 
Thanks Mile-O-Phile,

With this as my criteria, not wanting to appear thick (bit late now I think...) what should the rest of my query be set to...

Thinking I may be missing something else due to the fact it still doesn't work...

I have attached what my query is looking like at present so that any obvious errors on my part can be corrected!!

Thanks

Andy
 

Attachments

Why have you picked the same field twice? I'm guessing you don't need to group by the date received so, check the field with the criteria and delete the other.
 
I put that in just to stop the error!!

Otherwise I would just have the column with my "where" statement which doesn't show anything and I get an error.

That was just one example of the many things I have tried.

I thing I have covered everything from "group by" to "where" with one or two columns and still cannot get this to pick up the contents of the text boxes!!

I am beginning to think this isn't a straightforward question...

I am even trying at present to create a new table tblDates with start date and end date fields and linking these unbound boxes to them...

This only works after I have exited the form as without doing so the table isn't updated with the contents on the text boxes!!

I have never used update queries but am attempting (unsuccessfully) to get these to update the table real time with the form open so that I can run my reports afterwards.

Do you think this way is better?

Any ideas why this isn't working either?

Thanks

Andy
 
Hi,

I have had to select my dates and then exit the form, then re-open the form and THEN run my reports and it works!

Bit of a silly workaround, but it works!!

Thanks everyone for your suggestions.

Andy
 

Users who are viewing this thread

Back
Top Bottom