Guest_imported
New member
- Jan 1, 1970
- 0
I have a Main form that can display all record. I also have a subform that allow user to add new recordset to the table.
The question that I have is how to open a main form with the new record that just added to the subform.
Below is the function:
Private Sub cmdAddNew_Click()
On Error GoTo Err_cmdAddNew_Click
'close my subform after new record is added to table
DoCmd.Close
'Close mainform to refresh data
DoCmd.Close acForm, "Mainform", acSaveYes
'Reopen the main form with the new added record
'This line is not working right.
DoCmd.OpenForm "Mainform",acViewPreview,
"Combo439 = " & LineNumber
End Sub
Any helps would be greatly appreciated.
The question that I have is how to open a main form with the new record that just added to the subform.
Below is the function:
Private Sub cmdAddNew_Click()
On Error GoTo Err_cmdAddNew_Click
'close my subform after new record is added to table
DoCmd.Close
'Close mainform to refresh data
DoCmd.Close acForm, "Mainform", acSaveYes
'Reopen the main form with the new added record
'This line is not working right.
DoCmd.OpenForm "Mainform",acViewPreview,
"Combo439 = " & LineNumber
End Sub
Any helps would be greatly appreciated.