Dim rec As Recordset
Dim db As Database
Dim StrSQL3 As String
StrSQL3 = "Select* From EnrollmentInformationTable WHERE (((EnrollmentInformationTable.EmployeeSSN)=[forms]![updateform]![temp]) AND ((EnrollmentInformationTable.EmployeeLastName)=[forms]![updateform]![name]));"
Set rec = CurrentDb.OpenRecordset(StrSQL3)
If rec.BOF And rec.EOF Then
MsgBox ("You did not type a valid last name and social security number."), vbCritical
Me.SSN.SetFocus
Else
Set QDF = CurrentDb.QueryDefs("EnrollmentFormUpdateQuery")
QDF.SQL = StrSQL3
QDF.Close
DoCmd.OpenForm "EnrollmentFormUpdate"
DoCmd.Close acForm, "UpdateForm"
End If
What's wrong with the above code. I'm getting the following error message:
"Too few parameters. Expected 2."
I always have a problem when I try to use the select record statements.
Dim db As Database
Dim StrSQL3 As String
StrSQL3 = "Select* From EnrollmentInformationTable WHERE (((EnrollmentInformationTable.EmployeeSSN)=[forms]![updateform]![temp]) AND ((EnrollmentInformationTable.EmployeeLastName)=[forms]![updateform]![name]));"
Set rec = CurrentDb.OpenRecordset(StrSQL3)
If rec.BOF And rec.EOF Then
MsgBox ("You did not type a valid last name and social security number."), vbCritical
Me.SSN.SetFocus
Else
Set QDF = CurrentDb.QueryDefs("EnrollmentFormUpdateQuery")
QDF.SQL = StrSQL3
QDF.Close
DoCmd.OpenForm "EnrollmentFormUpdate"
DoCmd.Close acForm, "UpdateForm"
End If
What's wrong with the above code. I'm getting the following error message:
"Too few parameters. Expected 2."
I always have a problem when I try to use the select record statements.
