Hello there
I have a MainForm in which I have build in a SubForm. The SubForm (Named [frmJournal] shall only be visible and functionel when called upon. For that I have a button (Click) on the MainForm when pressed makes the SubForm visible and should make the SubForm active and ready for a new new record. What happens is a seperate window opens, and that is not my intension.
I belive that my problem has something to do with the referencing to the SubForm (Path). But I dont have any idea of how to put this into the DoCmd.OpenForm argument! I have tried with the "Path" string (in the code) without luck. So I need help/info on how to put a path into the DoCmd.OpenForm argument or how to solve this issue.
The color green is code which is bypassed, color red is active code.
Private Sub cmdNy_Click()
Dim Path As String
tglDetalje = True
'Path = Forms![frmJournalMain]![frmJournal].Form
'Vis og skjul underformular-felterne
frmJournalMainSub1_Liste.Visible = False
frmJournal.Visible = True
'Me!frmJournal.Form.Sagsnummer.Enabled = False
'Me!frmJournal.Form.GoToNewRecord
DoCmd.OpenForm "frmJournal", acNormal
'DoCmd.GoToRecord acDataForm, "frmJournal", acNewRec
End Sub
Hope someone are able to help me here.
Regards
Morten