display data in subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My from displays Members. That form has a subform that displays Doctors.
I need to add a command button to add Doctors and have them display on the
subform.
When I clisk the command button it opens a form with all my Doctors.
How can I adjust this code to open that form in ADD mode and link it to that
Parent form?

Private Sub CmdPROV_Click()
On Error GoTo Err_CmdPROV_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "f_ProviderDetail"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_CmdPROV_Click:
Exit Sub

Err_CmdPROV_Click:
MsgBox Err.Description
Resume Exit_CmdPROV_Click

End Sub
 
Best bet IMO is to simply create a new stand-alone bound form which opens
when you click the button. In the FORM OPEN event, you insert this code:

DoCmd.GoToRecord , , acNewRec

Then add a button to the new form that just says "Done". When they click it,
the following code executes:

If Me.Dirty then Me.Dirty = False

Docmd.Close acForm, "frmMyFormName"
 
Fantastic
Thank YOU





Dennis said:
Best bet IMO is to simply create a new stand-alone bound form which opens
when you click the button. In the FORM OPEN event, you insert this code:

DoCmd.GoToRecord , , acNewRec

Then add a button to the new form that just says "Done". When they click it,
the following code executes:

If Me.Dirty then Me.Dirty = False

Docmd.Close acForm, "frmMyFormName"
 
Back
Top