making default value invisible

RichieP

Rock on!
Local time
Today, 07:08
Joined
Apr 16, 2003
Messages
48
I have a form with an unbound txtbox. The default for the txtbox is "01-Jan-1900". I don't want the user to see this date but if they change it then they should see it. In the before update action for the txtbox I put in this code:

If Me.txtDate1 = "01-Jan-1900" Then
Me.txtDate1.ForeColor = 16777215
Else
Me.txtDate1.ForeColor = 0

I'm presuming that 16777215 = white (the same colour as the background). However, it doesn't work, what am I doing wrong??? Please help.
 
I have END IF at the end, sorry, forgot to paste
 
You should use null as the default value for date fields.
 
if your using access2k or more you could use conditionally
formatting to acheive your desired result
 
Try this

If Me.txtDate1 = "01-Jan-1900" Then
Me.txtDate1.visible = False
Else
Me.txtDate1.visible = True
End If

In the properties of the txt box set it to visible No
 
Are they changing the date in that unbound txt box or is this txt box getting the information from another. If you hide the txt box then they will be unable to change the date.

I dont really understand what you are trying to do
 

Users who are viewing this thread

Back
Top Bottom