I have the main “frmList of Individuals” which has a subform “frmAppointments” which consists of several scheduled appointments. The Primary Key in the “frmList of Individuals” is [ClientID#] and the two Primary Keys in “frmAppointments” are [ClientID#] and [ApptID#]. I have a Command Button on the “frmAppointments” which the Code (needing some work) is listed below to print the “frmAppointment Letter”, which consists of the individual, department, date and time of appointment, etc.
Private Sub cmdPrint_Current_Record_Click()
On Error GoTo Err_cmdPrint_Current_Record_Click
Dim stDocName As String
stDocName = "macPrint frmAppointment Letter"
DoCmd.RunMacro stDocName
Exit_cmdPrint_Current_Record_Click:
Exit Sub
Err_cmdPrint_Current_Record_Click:
MsgBox Err.Description
Resume Exit_cmdPrint_Current_Record_Click
End Sub
What I want is when someone schedules an appointment, they enter the “frmList of Individuals”, enter the scheduled date/time, then Press the Print Command Button and the “frmAppointment Letter” is generated, and the two “frmList of Individuals” and “frmAppointment Letter” are then closed.
In the “macPrint frmAppointment Letter” the ACTIONS: a) RunCommand: SelectRecord; b) OpenForm: Form Name: frmApointment Letter, View: Blank; Filter Name: Blank; Where Condition: Blank; c) Close: frmList of Individuals; d) Close: frmAppointment Letter.
When the button is pressed, the two forms get closed, however, nothing prints. Hopefully with the information provided above, how can I get just the selected appointment [ApptID#] with the matching [ClientID#] to print the “frmAppointment Letter” and close the two forms. I'm sure there is something missing in the Where Condition. Suggestions would be grateful.
Private Sub cmdPrint_Current_Record_Click()
On Error GoTo Err_cmdPrint_Current_Record_Click
Dim stDocName As String
stDocName = "macPrint frmAppointment Letter"
DoCmd.RunMacro stDocName
Exit_cmdPrint_Current_Record_Click:
Exit Sub
Err_cmdPrint_Current_Record_Click:
MsgBox Err.Description
Resume Exit_cmdPrint_Current_Record_Click
End Sub
What I want is when someone schedules an appointment, they enter the “frmList of Individuals”, enter the scheduled date/time, then Press the Print Command Button and the “frmAppointment Letter” is generated, and the two “frmList of Individuals” and “frmAppointment Letter” are then closed.
In the “macPrint frmAppointment Letter” the ACTIONS: a) RunCommand: SelectRecord; b) OpenForm: Form Name: frmApointment Letter, View: Blank; Filter Name: Blank; Where Condition: Blank; c) Close: frmList of Individuals; d) Close: frmAppointment Letter.
When the button is pressed, the two forms get closed, however, nothing prints. Hopefully with the information provided above, how can I get just the selected appointment [ApptID#] with the matching [ClientID#] to print the “frmAppointment Letter” and close the two forms. I'm sure there is something missing in the Where Condition. Suggestions would be grateful.