Your wallpaper is prettier than ours in the MS Office forums!!
Need some help, obviously.
I create a cmdButton in a form that goes to open another form. I need to edit it so that it:
a) Opens the form in data entry view (I don't have to make TWO forms, right??) Current code:
Private Sub cmdAddNewPat_Click()
On Error GoTo Err_cmdAddNewPat_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmPatients"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdAddNewPat_Click:
Exit Sub
Err_cmdAddNewPat_Click:
MsgBox Err.Description
Resume Exit_cmdAddNewPat_Click
End Sub
b) Shows the form of the person in the CURRENT form. The current form shows the patient name, etc., and then has a subform for visits. I have a command button that, when clicked, I'd like it to open that Patient's record (PatID is the ID primary key for the patient). Current code shows all records.:
Private Sub cmdViewEditPatRecord_Click()
On Error GoTo Err_cmdViewEditPatRecord_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmPatients"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdViewEditPatRecord_Click:
Exit Sub
Err_cmdViewEditPatRecord_Click:
MsgBox Err.Description
Resume Exit_cmdViewEditPatRecord_Click
End Sub
I hugely appreciate the code, if possible. LOL Anne Troy
Need some help, obviously.
I create a cmdButton in a form that goes to open another form. I need to edit it so that it:
a) Opens the form in data entry view (I don't have to make TWO forms, right??) Current code:
Private Sub cmdAddNewPat_Click()
On Error GoTo Err_cmdAddNewPat_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmPatients"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdAddNewPat_Click:
Exit Sub
Err_cmdAddNewPat_Click:
MsgBox Err.Description
Resume Exit_cmdAddNewPat_Click
End Sub
b) Shows the form of the person in the CURRENT form. The current form shows the patient name, etc., and then has a subform for visits. I have a command button that, when clicked, I'd like it to open that Patient's record (PatID is the ID primary key for the patient). Current code shows all records.:
Private Sub cmdViewEditPatRecord_Click()
On Error GoTo Err_cmdViewEditPatRecord_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmPatients"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdViewEditPatRecord_Click:
Exit Sub
Err_cmdViewEditPatRecord_Click:
MsgBox Err.Description
Resume Exit_cmdViewEditPatRecord_Click
End Sub
I hugely appreciate the code, if possible. LOL Anne Troy