Need help with VBA

C

cynthia

I had somebody helping me with the code and now just
realized that we stopped 1/2 way through. here is the
code that I've got. This code is for a search box. We
have 4 search options, one on "case ID" and that is
working fine, the other 3 are not and they are

"[InsPolicyNo]=
"txtFindFirstName").Value & "' AND [InsLastName]=
"IsNull([ResearcherID])=


Here is the code, I know I'm missing the code to open the
form for these 3 other search type, Is there anybody out
there that can help me? Thank you

Private Sub cmdFindCase_Click()
On Error GoTo Err_Handler

Dim strWhere As String

With Me
Select Case grpSearchFor.Value
Case 1: strWhere = "[CaseID]='" & .Controls
("cboFindCaseID").Value & "'"
Case 2: strWhere = "[InsPolicyNo]='"
& .Controls("cboFindPolicyNo").Value & "'"
Case 3: strWhere = "[InsFirstName]='"
& .Controls("txtFindFirstName").Value & "' AND
[InsLastName]='" & .Controls("txtFindLastName").Value & "'"
Case 4: strWhere = "IsNull([ResearcherID])=" &
True
End Select
End With

If Not IsNull(DLookup("[CaseTypeID]", "tblCases",
strWhere)) Then
DoCmd.OpenForm "frmAssign", acNormal, ,
strWhere, acFormEdit
Else
MsgBox "No matching record could be found."
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top