Subform with Date Picker

wilderfan

Registered User.
Local time
Today, 06:25
Joined
Mar 3, 2008
Messages
172
On my main form, I have a subform to input multiple dates, using date picker.

I also have a text box on the main form to input single dates, again using Date Picker.

On entering both the single date text box and the subform, I don't want the (default) date to be visible. I only want the date to be visible once I have selected a date from the Date Picker.

I have figured out how to do this with the single date text box. I have simply defaulted the forecolor to be white so that you can't see the font against the white backcolor. Then on the Change Event, I set the forecolor to be black. Works like a charm.

However...

This same approach will not work with the subform. I've tried playing around with a bunch of different events, but so far nothing allows me to re-create what I am able to do with the single date text box on the main form.


Any ideas?
 
...On entering both the single date text box and the subform, I don't want the (default) date to be visible...
So why have a Default Value at all and have to go through this song and dance?

To have a Date assigned if the user doesn't make a selection from the DatePicker and to not have a Default Date Visible, leave the Default Value blank and then use code like this:
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
 If Nz(Me.txtFedExpireDt, "") = "" Then
  Me.txtFedExpireDt = #12/31/2013#
 End If
End Sub
replacing 12/31/2013 with what would be your Default Date.

Linq ;0)>
 
I want to set a default value for the date (for both the single date text box and the subform) because the dates relate to historical records from the 1950's and 1960's.

If I don't set an initial default, then Date Picker opens up on the current month. The time spent backtracking to the 50's and 60's would irritate most users.
 

Users who are viewing this thread

Back
Top Bottom