H
HeislerKurt
I have main form, frmPatients, based on tblPatients. The main form
shows the patient's name, DOB, etc. These controls are not enabled.
I created my own toolbar with an item, "Add new patient." Clicking
this opens up a model form, frmNewPatient (also based on tblPatients;
Data Entry set to "Yes"). The user enters information for the new
patient (name, DOB, etc.), and then clicks a save button.
When frmNewPatient pops up, frmPatients moves to a new record using:
###
Private Sub Form_Open(Cancel As Integer)
Forms!frmPatients.SetFocus
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
DoCmd.GoToRecord , , acNewRec
End Sub
###
But when the user clicks the Save button on frmNewPatient, the new
record is added to the table but frmPatients is not refreshed to show
the new information. What should I add to the code to do this?
###
Private Sub cmdSavePatient_Click()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
DoCmd.Close
End Sub
###
I'm going to add an "Edit Patient" button on the toolbar, so I'll need
similar handing for that, too.
Thanks.
Kurt
shows the patient's name, DOB, etc. These controls are not enabled.
I created my own toolbar with an item, "Add new patient." Clicking
this opens up a model form, frmNewPatient (also based on tblPatients;
Data Entry set to "Yes"). The user enters information for the new
patient (name, DOB, etc.), and then clicks a save button.
When frmNewPatient pops up, frmPatients moves to a new record using:
###
Private Sub Form_Open(Cancel As Integer)
Forms!frmPatients.SetFocus
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
DoCmd.GoToRecord , , acNewRec
End Sub
###
But when the user clicks the Save button on frmNewPatient, the new
record is added to the table but frmPatients is not refreshed to show
the new information. What should I add to the code to do this?
###
Private Sub cmdSavePatient_Click()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
DoCmd.Close
End Sub
###
I'm going to add an "Edit Patient" button on the toolbar, so I'll need
similar handing for that, too.
Thanks.
Kurt