N
NFL
I created an unbound form to search for names by using a combo box and was
able to combine two fields into one. It works great and this is what I have
in the row sources:
SELECT Students.LastName & ", " & Students.FirstName FROM Students;
I also created a command button on the same form look for the names and to
place that data on the report. What I get is an error "Enter Parameter
Value" Expr1.
Is there a way I can combine the Last Name and First Name fields in one
textbox? Here is the code from the command button.
Private Sub Command25_Click()
On Error GoTo Err_Command25_Click
Me.cboFindName.SetFocus
If Me.cboFindName.Text = "" Then
MsgBox "You must select a student to view class schedule." _
& vbCrLf _
& " Please try again!", vbCritical, "Student Query Error Message"
Exit Sub
Else
End If
Dim stDocName As String
stDocName = "StudentsQueryReport"
DoCmd.OpenReport stDocName, acViewPreview
Exit_Command25_Click:
Exit Sub
Err_Command25_Click:
MsgBox Err.Description
Resume Exit_Command25_Click
End Sub
able to combine two fields into one. It works great and this is what I have
in the row sources:
SELECT Students.LastName & ", " & Students.FirstName FROM Students;
I also created a command button on the same form look for the names and to
place that data on the report. What I get is an error "Enter Parameter
Value" Expr1.
Is there a way I can combine the Last Name and First Name fields in one
textbox? Here is the code from the command button.
Private Sub Command25_Click()
On Error GoTo Err_Command25_Click
Me.cboFindName.SetFocus
If Me.cboFindName.Text = "" Then
MsgBox "You must select a student to view class schedule." _
& vbCrLf _
& " Please try again!", vbCritical, "Student Query Error Message"
Exit Sub
Else
End If
Dim stDocName As String
stDocName = "StudentsQueryReport"
DoCmd.OpenReport stDocName, acViewPreview
Exit_Command25_Click:
Exit Sub
Err_Command25_Click:
MsgBox Err.Description
Resume Exit_Command25_Click
End Sub