darnnnel
12-12-2007, 08:06 AM
Hello everyone. i have a fom and subform (they are not linked).The subform has a date field named StartDate. i have a button on the form that when clicked will change the recordset of the subform to show StartDate of today. When i hit the command button, the subform becomes blank.Its driving me crazy.Here is my code:
Private Sub cmdToday_Click()
Dim sSQL As String
Dim Today
Today = Format(Now(), "mm/dd/yyyy")
sSQL = "SELECT * FROM QueryCases WHERE QueryCases.StartDate = " & Today
Forms!ViewCases![ViewCasesSubform].Form.RecordSource = sSQL
End Sub
Private Sub cmdToday_Click()
Dim sSQL As String
Dim Today
Today = Format(Now(), "mm/dd/yyyy")
sSQL = "SELECT * FROM QueryCases WHERE QueryCases.StartDate = " & Today
Forms!ViewCases![ViewCasesSubform].Form.RecordSource = sSQL
End Sub