I’m creating a database for the first time and am new to VBA Access, please.
When I click a button on my subform (which is in continuous view) it opens another form, Node Setting Form ("popfrmNEWNodeSetting2" in the code below). The pop up Node Setting Form will open blank with no fields for newly added records to the originating sub form. Can someone help, please?
I’ve been working on the code below and it will open the Node Setting Form for an existing record as Read Only, and it will End Sub for a record on the subform that is blank. But on newly added records in the subform, it will open the Node Setting Form as blank.
I want it to save the newly added record (the 'dirty record', I believe it's called) from the subform and open the Node Setting Form in edit/add record mode so the user can add the settings for the node from the subform. I have trouble with IF, ELSEIF, ELSE just in general, anyway, so that doesn’t help matters.
(I tried adding links to pics of the main/subform and the Node Setting form but it's not working. I think I need to post more before I'm able to.)
I would appreciate any help. Thanks.
When I click a button on my subform (which is in continuous view) it opens another form, Node Setting Form ("popfrmNEWNodeSetting2" in the code below). The pop up Node Setting Form will open blank with no fields for newly added records to the originating sub form. Can someone help, please?
I’ve been working on the code below and it will open the Node Setting Form for an existing record as Read Only, and it will End Sub for a record on the subform that is blank. But on newly added records in the subform, it will open the Node Setting Form as blank.
I want it to save the newly added record (the 'dirty record', I believe it's called) from the subform and open the Node Setting Form in edit/add record mode so the user can add the settings for the node from the subform. I have trouble with IF, ELSEIF, ELSE just in general, anyway, so that doesn’t help matters.
(I tried adding links to pics of the main/subform and the Node Setting form but it's not working. I think I need to post more before I'm able to.)
I would appreciate any help. Thanks.
Code:
Private Sub cmdViewNodeSettingsFrm_Click()
If Me.Dirty Then
‘added Me.Dirty = False b/c thought it saves a ‘dirty record’
Me.Dirty = False
DoCmd.OpenForm "popfrmNEWNodeSetting2", acNormal, , "[NodeID]=" & [NodeID], acFormAdd, acWindowNormal
ElseIf IsNull(Me.NodeID) Then
Exit Sub
Else
DoCmd.OpenForm "popfrmNEWNodeSetting2", acNormal, , "[NodeID]=" & [NodeID], acFormReadOnly, acWindowNormal
End If
End Sub