An Unbound Textbox Date In A Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to use an Unbound Textbox entered as a Date, & to subtract another
Date from that value. But I can't get that to work.

The subtraction would be conducted in an IIF.

Any ideas?

TIA - Bob
 
Use DateDiff() in the query, e.g.:
DateDiff("d", [SomeField], [Forms].[SomeForm].[SomeTextBox])

To ensure that Access understands the unbound text box is a date:
1) Set the Format property of the text box to Short Date or similar.
2) Declare the parameter in your query: Parameters on Query menu, and enter
into the dialog:
[Forms].[SomeForm].[SomeTextBox] Date/Time
 
Allen - Works great. Thank you - Bob

Allen Browne said:
Use DateDiff() in the query, e.g.:
DateDiff("d", [SomeField], [Forms].[SomeForm].[SomeTextBox])

To ensure that Access understands the unbound text box is a date:
1) Set the Format property of the text box to Short Date or similar.
2) Declare the parameter in your query: Parameters on Query menu, and enter
into the dialog:
[Forms].[SomeForm].[SomeTextBox] Date/Time

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Bob Barnes said:
I want to use an Unbound Textbox entered as a Date, & to subtract another
Date from that value. But I can't get that to work.

The subtraction would be conducted in an IIF.
 
Back
Top