Date and Time - TextBox (1 Viewer)

Garcimat

Member
Local time
Today, 19:58
Joined
Jun 7, 2022
Messages
67
Hi guys
I hate work with date and times, on the record table these fields are Date/Time on my form the text boxes show like this (with values) even when they are not enabled.
I have tried to use .value=empty and still no success, I want these fields to be blank like the others.

thank you
 

Attachments

  • image4.png
    image4.png
    27.4 KB · Views: 79

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 16:58
Joined
May 7, 2009
Messages
19,170
do you have Default Value for those fields? remove them.
 

Gasman

Enthusiastic Amateur
Local time
Today, 08:58
Joined
Sep 21, 2011
Messages
14,050
So it is showing the mask?
Cannot see pic clearly on phone.
 

Garcimat

Member
Local time
Today, 19:58
Joined
Jun 7, 2022
Messages
67
I tried to do a private sub to clean the fieds.... text=Empty didnt work... so I tried text=" " and I got a Mask error

Private Sub DateTime()
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''Change Over
txt_ChangeOverTime.Enabled = True
txt_ChangeOverTime.SetFocus
txt_ChangeOverTime.Text = " "
txt_ChangeOverTime.Enabled = False
Form.SetFocus
txt_ChangeOverDate.Enabled = True
txt_ChangeOverDate.SetFocus
txt_ChangeOverDate.Text = " "
txt_ChangeOverDate.Enabled = False
Form.SetFocus
...
 

isladogs

MVP / VIP
Local time
Today, 08:58
Joined
Jan 14, 2017
Messages
18,186
Both of those are the zero values for times & dates respectively.
Remove the default value of 0 in the fields / form controls.
Also recommend you remove the input mask as its often more of a nuisance than a help
 

Garcimat

Member
Local time
Today, 19:58
Joined
Jun 7, 2022
Messages
67
I got it, I call this Sub on every btnName_Click() Thank you guys for your help.

Private Sub DateTime()
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''Change Over
txt_ChangeOverTime.Enabled = True
txt_ChangeOverTime.SetFocus
txt_ChangeOverTime.Text = ""
txt_ChangeOverTime.Enabled = False
Form.SetFocus
txt_ChangeOverDate.Enabled = True
txt_ChangeOverDate.SetFocus
txt_ChangeOverDate.Text = ""
txt_ChangeOverDate.Enabled = False
Form.SetFocus
''''''''''''''''''''''''''''''''''''''''''''''''''''''Return PTF
txt_PermitReturnedTime.Enabled = True
txt_PermitReturnedTime.SetFocus
txt_PermitReturnedTime.Text = ""
txt_PermitReturnedTime.Enabled = False
Form.SetFocus
txt_PermitReturnedDate.Enabled = True
txt_PermitReturnedDate.SetFocus
txt_PermitReturnedDate.Text = ""
txt_PermitReturnedDate.Enabled = False
Form.SetFocus
txt_RepBackoKTime.Enabled = True
txt_RepBackoKTime.SetFocus
txt_RepBackoKTime.Text = ""
txt_RepBackoKTime.Enabled = False
Form.SetFocus
txt_RepBackoKDate.Enabled = True
txt_RepBackoKDate.SetFocus
txt_RepBackoKDate.Text = ""
txt_RepBackoKDate.Enabled = False
Form.SetFocus
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''Modify Limits
txt_PermitLimitsModifiedTime.Enabled = True
txt_PermitLimitsModifiedTime.SetFocus
txt_PermitLimitsModifiedTime.Text = ""
txt_PermitLimitsModifiedTime.Enabled = False
Form.SetFocus
txt_PermitLimitsModifiedDate.Enabled = True
txt_PermitLimitsModifiedDate.SetFocus
txt_PermitLimitsModifiedDate.Text = ""
txt_PermitLimitsModifiedDate.Enabled = False
Form.SetFocus
End Sub
 

Users who are viewing this thread

Top Bottom