Update a Date in an expression from a Form control

naungsai

Abecedarian
Local time
Tomorrow, 01:53
Joined
Sep 8, 2008
Messages
123
Dear Friends

I have a query. If the [Date1] is before a particular date, I want to categorize it "Old", otherwise "New" in [NewOld] column of a query. I use the following expression which I got it from one of the friend in this forum. It is OK to run it.

NewOld: IIf([Date1]<#1/1/2008#,"Old","New")

Now instread of correcting the date in the expression manually, I want to enter the date in a form text box. Whenever I enter the date in the text box the expression will update the date in this "NewOld" column if the query.

How should I do it?:confused:
 
Yes

Use

NewOld: IIf([Date1]<Nz(Me.TextDate,Date()),"Old","New")

Then Nz() eliminates an error until a valid date is entered.

David
 
Dear Crake

I mean the expression in my post is fine. It is OK.

I just want to change the date in the expression from a form control.
I don't want to change it by opening the query in the design view.

Thanks
 

Users who are viewing this thread

Back
Top Bottom