prdinesh81
New member
- Local time
- Today, 16:49
- Joined
- Jun 30, 2008
- Messages
- 3
Hi,
How to assign Date variable into existing recordset variable and the same date variable should be assigned to [START_DATE] label in forms, it should update date in forms while we add new data . How to resolve using VBA code in MS Access 2003.
Please see the below VBA code for your information.
Private Sub Combo35_AfterUpdate()
' Find the record that matches the control.
Dim RS As Object
Dim sMyVar As Date
Set RS = Me.Recordset.Clone
'MsgBox ("RecordCount: " & RS.RecordCount)
RS.FindFirst "[URL_ID] = '" & Me![Combo35] & "'"
sMyVar = RS![START_DATE]
MsgBox (sMyVar)
'RS.FindFirst "[START_DATE] = Null"
'Set RS![START_DATE] = Now()
'MsgBox ("Before Now " & sMyVar)
' sMyVar = Date
'MsgBox ("After Now " & sMyVar)
'If sMyVar Is Null Then RS.[START_DATE] = Now()
'If IsNull(START_DATE) Then MsgBox (" Start date is null")
If Not RS.EOF Then Me.Bookmark = RS.Bookmark
End Sub
Please help me ASAP
How to assign Date variable into existing recordset variable and the same date variable should be assigned to [START_DATE] label in forms, it should update date in forms while we add new data . How to resolve using VBA code in MS Access 2003.
Please see the below VBA code for your information.
Private Sub Combo35_AfterUpdate()
' Find the record that matches the control.
Dim RS As Object
Dim sMyVar As Date
Set RS = Me.Recordset.Clone
'MsgBox ("RecordCount: " & RS.RecordCount)
RS.FindFirst "[URL_ID] = '" & Me![Combo35] & "'"
sMyVar = RS![START_DATE]
MsgBox (sMyVar)
'RS.FindFirst "[START_DATE] = Null"
'Set RS![START_DATE] = Now()
'MsgBox ("Before Now " & sMyVar)
' sMyVar = Date
'MsgBox ("After Now " & sMyVar)
'If sMyVar Is Null Then RS.[START_DATE] = Now()
'If IsNull(START_DATE) Then MsgBox (" Start date is null")
If Not RS.EOF Then Me.Bookmark = RS.Bookmark
End Sub
Please help me ASAP