Trouble with linking to query

  • Thread starter Thread starter jon
  • Start date Start date
J

jon

Hi All
I have a query with a criteria of
Date()-120
Which works, but I want to be able to alter the criteria and link to a combo
box on a form and when I do this no records come back even though in the
combo box is the same >Date()-120.

The code I have put in the criteria box is

[Forms]![frmGraphSelection]![txtSRSRange]
do I have to format this txt box so it is a string or some thing as I want
to be able to put a range of dates or the last 90 or 120 day

Any advise please.

Ta

Jon
 
Hi Jon,

try

cDate([Forms]![frmGraphSelection]![txtSRSRange])-120

or

DateValue([Forms]![frmGraphSelection]![txtSRSRange])-120

under your date field


.... textboxes are... well, text :)

~~~

"> The code I have put in the criteria box is
[Forms]![frmGraphSelection]![txtSRSRange]"

the criteria under what field?


Warm Regards,
Crystal
*
(: have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*


Hi All
I have a query with a criteria of
Date()-120
Which works, but I want to be able to alter the criteria and link to a combo
box on a form and when I do this no records come back even though in the
combo box is the same >Date()-120.

The code I have put in the criteria box is

[Forms]![frmGraphSelection]![txtSRSRange]
do I have to format this txt box so it is a string or some thing as I want
to be able to put a range of dates or the last 90 or 120 day

Any advise please.

Ta

Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top