I need to edit a specific record on a main form using a popup form. this is the code:
Expand|Select|Wrap|Line Numbers
- Private Sub resetThisForm(strAction As String)
- On Error GoTo ErrorHandler
- Dim rst As DAO.Recordset
- Select Case strAction
- Case "Swap"
- Set rst = Forms!frmMain.Recordset
- With rst
- .Bookmark = Forms!frmMain.Bookmark
- .Edit
- !fkLocationID = Me.txtLocationPK
- .Update
- End With
- Case "Add"
- '...
- End Select
- Me.Visible = False
- exitSub:
- Set rst = Nothing
- Exit Sub
- ErrorHandler:
- MsgBox "Error No: " & Err.Number & vbNewLine _
- & "Error Details: " & Err.Description & vbNewLine _
- & "Error in Sub: frmMain_TableAdd\resetThisForm"
- Resume exitSub
- End Sub
Expand|Select|Wrap|Line Numbers
- Private Sub dresetThisForm(strAction As String)
- On Error GoTo ErrorHandler
- Select Case strAction
- Case "Swap"
- With Forms!frmMain.Recordset
- .Edit
- !fkLocationID = Me.txtLocationPK
- .Update
- End With
- Case "Add"
- '...
- End Select
- Me.Visible = False
- exitSub:
- Exit Sub
- ErrorHandler:
- MsgBox "Error No: " & Err.Number & vbNewLine _
- & "Error Details: " & Err.Description & vbNewLine _
- & "Error in Sub: frmMain_TableAdd\resetThisForm"
- Resume exitSub
- End Sub