I am new to this so any help would be greatly appreciated. I have a form called weekly attendance sheet that I want to open based on employee's name selected in combo box but when I click on button I get prompted to enter attendance.id.
See below for code that was created.
Private Sub Attendance_Form_Click()
On Error GoTo Err_Attendance_Form_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "WEEKLY ATTENDANCE SHEET"
stLinkCriteria = "[Name]=" & "'" & Me![Combo25] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormEdit
Exit_Attendance_Form_Click:
Exit Sub
Err_Attendance_Form_Click:
MsgBox Err.Description
Resume Exit_Attendance_Form_Click
End Sub
Thanks
Ricky
See below for code that was created.
Private Sub Attendance_Form_Click()
On Error GoTo Err_Attendance_Form_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "WEEKLY ATTENDANCE SHEET"
stLinkCriteria = "[Name]=" & "'" & Me![Combo25] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormEdit
Exit_Attendance_Form_Click:
Exit Sub
Err_Attendance_Form_Click:
MsgBox Err.Description
Resume Exit_Attendance_Form_Click
End Sub
Thanks
Ricky