Control value based on two other controls

Ripleyclone

New member
Local time
Today, 02:39
Joined
Mar 4, 2011
Messages
6
Hi, hopefully someone can help.

I have a form called frmAssignments with a text box showing DateCompleted.

I have another form (which opens from frmAssignments) on which I have two date text boxes: SigDate1 and SigDate2. The date will be in either one or other, never both so one will always be empty.

I'm trying to get the DateCompleted control to show the date from the SigDate box that has a date in.

(maybe when the 2nd form is closed or as soon as the SigDate is entered?)

Thanks
 
As the control source (you can show it but it won't be updatable) using:

=IIf(Len([SigDate1] & "")>0,[SigDate1], [SigDate2])

although you might need to work with that a bit if both can be empty.
 
Both can be empty so I see your point. I tried it and got either #name error or #type error when either the 2nd form was open with both dates empty or when I closed it.

But, I included SigDate1 and SigDate2 in the main form's query, put on the main form and made them invisible, then referenced them directly with the code you gave me. Now when they are both empty the DateCompleted is also empty.

Works a treat now, so thanks :)
 

Users who are viewing this thread

Back
Top Bottom