Hi all, Im new to this fourm!
I am running the following subroutine and it does not seem to be returning the proper results and maybe you guys can see something I dont..
Private Sub Command8_Click()
'verifys if there is data for the selected log date combobox - na 11_19_13
Dim Lresults As Long
Lresults = DCount("ID", "tblTIMESHEET", "LOG_DATE=" & Combo2)
If Lresults = 0 Then
MsgBox ("Please select another date" & vbCrLf & "No data for selected date!")
Else
Me.Visible = False
DoCmd.OpenForm ("frmTIMESHEET_EDITS")
End If
End Sub
What im tryin to do:
I'm using the dcount function check to see if there is an already existing record with the selected combobox date, if so, then proceed to open form event, if not, then deisplay msgbox for user to selected another date.
Whats Happening:
It continues to tell me there are no results even though I do have records in my [LOG_DATE] with the selected date in the combobox.
Any help is appericiated.. I think I may just be overlooking something simple.
Thanks experts!
Regards,
Naeem~