Add A New Record Using SubForms

  • Thread starter Thread starter Diane Vasser via AccessMonster.com
  • Start date Start date
D

Diane Vasser via AccessMonster.com

Hello Everyone,

I have a main form that has several subforms on it. I created a button
using the wizard to add a new record. The button is on the main form.

When the add button is clicked only the main form is cleared, but the
subforms disappear. What am I doing wrong.
 
Diane said:
Hello Everyone,

I have a main form that has several subforms on it. I created a button
using the wizard to add a new record. The button is on the main form.

When the add button is clicked only the main form is cleared, but the
subforms disappear. What am I doing wrong.


Hi Diane,

Post the code- Just because the wizard generated it doesn't mean we
know what's going on.

Namaste,
kdot
 
Here's my code for the add new record button:

Private Sub Command21_Click()
On Error GoTo Err_Command21_Click


DoCmd.OpenForm "frmProfileAdd"
Forms!frmProfileAdd.DataEntry = True
Me.AllowEdits = True
DoCmd.GoToRecord , , acNewRec

Exit_Command21_Click:
Exit Sub

Err_Command21_Click:
MsgBox Err.Description
Resume Exit_Command21_Click

End Sub
 
Back
Top