S
SoggyCashew
Ok, I have a form frmSwitchboard with an option group optClassicficationGroup
with eight option values that I want to use as part of a search and a Combo
box named cboFindByEmployeeName with employees names would be used also. Now I
have a button that would be used called cmdFindClassicfication and in the
buttons OnClick event I have: (Only case 1 is shown) My question is how
would I also add the the option value as part of the stLinkCritera and if an
option isnt selected how could I bring up a msgbox like the one used for the
employee cbo box and set focus to that option? Thanks!
Private Sub cmdFindClassicfication_Click()
Dim stDocName As String
Dim stLinkCriteria As String
Select Case Me.optClassicficationGroup
Case 1
If Me.cboFindByEmployeeName & "" <> "" Then
stDocName = "frmSearchEntries"
stLinkCriteria = "[EmployeeName]=" & "'" & Me![cboFindByEmployeeName] &
"'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Me.Visible = False
Else
MsgBox "You Must Enter a Date.", vbOKOnly, "Date Not Entered"
Me.cboFindByEmployeeName.SetFocus
End If
Case 2
Case 3
Case 4
End Select
End Sub
with eight option values that I want to use as part of a search and a Combo
box named cboFindByEmployeeName with employees names would be used also. Now I
have a button that would be used called cmdFindClassicfication and in the
buttons OnClick event I have: (Only case 1 is shown) My question is how
would I also add the the option value as part of the stLinkCritera and if an
option isnt selected how could I bring up a msgbox like the one used for the
employee cbo box and set focus to that option? Thanks!
Private Sub cmdFindClassicfication_Click()
Dim stDocName As String
Dim stLinkCriteria As String
Select Case Me.optClassicficationGroup
Case 1
If Me.cboFindByEmployeeName & "" <> "" Then
stDocName = "frmSearchEntries"
stLinkCriteria = "[EmployeeName]=" & "'" & Me![cboFindByEmployeeName] &
"'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Me.Visible = False
Else
MsgBox "You Must Enter a Date.", vbOKOnly, "Date Not Entered"
Me.cboFindByEmployeeName.SetFocus
End If
Case 2
Case 3
Case 4
End Select
End Sub