OK, I have a combo box, when I load the form, its empty... If the member wishes to run a certain report, then they will choose this combo box, and pick a members name... then click the Run Report button. After that it needs to check if the combo box had anything in it... if so then run report accordingly. if not(its null or 0) then i need it to run a msgbox, and setfocus back to the combo box.
What am I doing wrong? This code is on the buttonClick()
Code:
If cboMemberNameHours.Value = 0 Then
MsgBox ("You need to enter a member to look up.")
cboMemberNameHours.SetFocus
Else
DoCmd.OpenReport "rptMemberHours", acViewPreview, , "tblPeople.PersonID = " & Me.cboMemberNameHours
End If
What am I doing wrong? This code is on the buttonClick()