Setting Date\Time Control Default value with VBA

joeKra

Registered User.
Local time
Yesterday, 22:43
Joined
Jan 24, 2012
Messages
208
Hi Guys

i am having an issue setting an instantiated forms' control. i am having RemDate ("Date") and RemTime ("Time") TextBox; so far the date textbox shows 1/1/1988 12:00 AM (the visible value is the time only) and the Time textbox Doesn't show anything; any inputs are appreciated !

Code:
            Set frm = New Form_ReminderAssigneesFrm
            frm.RecordSource = "Select * from ReminderAssignees Where RemID = " & Parent.RemID
            frm.RemID.DefaultValue = Parent.RemID
            With SetRS(frm.RecordSource)
                If Not .EOF Then
                    frm.RemDate.DefaultValue = FormatDateTime(.Fields("RemDate"), vbShortDate)
                    frm.RemTime.DefaultValue = .Fields("RemTime")
                    Debug.Print frm.RemTime.DefaultValue, frm.RemDate.DefaultValue
                End If
            End With
            frm.Visible = True
            frm.Modal = True
            clnClient.Add frm, CStr(frm.Hwnd)
 
Defaults are assigned after a record is created - you have not created a record before asking for the values
 
Seems like I wasn't clear enough.
I'm trying to set the default not to get it.
 

Users who are viewing this thread

Back
Top Bottom