Update Text Box from Date Control

DMerchen

Registered User.
Local time
Today, 10:08
Joined
Sep 9, 2008
Messages
94
Can you update a text box on a form based on input of a date control? Here is what I have. I have several date controls on my form, and I want to update a status textbox based on which of these date boxes is filled out, but I need the status to be filled into the table as well. Do I update the field on the table, and then requery the text box? Is there some other method for accomplishing this?

Any help is greatly appreciated.
 
I can't get this to work. Any ideas?

Private Sub Receipt_of_Parts_Date_AfterUpdate()

If IsNull([Receipt_of_Parts_Date]) Then
Status = " "
Else
Status.SetFocus
Status = "Parts Received- -Awaiting Evaluation"
End If

End Sub
 
Try:
Code:
Private Sub Receipt_of_Parts_Date_AfterUpdate()

If IsNull([Receipt_of_Parts_Date]) Then
  Me.Status = ""
Else
  Me.Status.SetFocus
  Me.Status = "Parts Received- -Awaiting Evaluation"
End If

End Sub
________________
 
Thanks Bob for the reply. I basically get an error when I run this, and it is the same thing that has been happening to me. It hi-lights the code in yellow and then when I roll over it with the mouse then it shows that Me.Status=Null. I am not sure why this is.
 
What error message do you get and which line is highlighted.
 
My fault on this one!! It was giving me the error of the field is too small to paste into the form. I increased the size on the source and it worked great. Thanks for the assist.
 
Glad you've got it working.

It may be better to use:
Code:
If Nz([Receipt_of_Parts_Date],"") = "" Then
 
Thanks again Bob,

I am curious why this would be the better choice to use. This is for my own personal learning, so if you wouldn't mind sharing some wisdom it would be greatly appreciated.

Thanks!!
 
The code you had would test for and catch a Null value but not a zero length string.
The code I suggested should catch both.
 

Users who are viewing this thread

Back
Top Bottom