Adding new record in tab subform

  • Thread starter forcefield via AccessMonster.com
  • Start date
F

forcefield via AccessMonster.com

Hi everyone,
I have a main form, frmMain with a tab control.. There are 2 pages on the tab
control and each page has a subform containing only several option groups
These subforms are linked to main form by Child and Master relationship.
What I would to do is when I click a button on the main form I would like
both the subforms add a new blank page of option groups for user to check. I
was able to get a blank new record for the second page or subform but not
the first page or subform. Can someone please correct my code?
Thanks

Private Sub cmdNew_Click()
On Error GoTo Err_cmdNew_Click

Me.sfrmOne.SetFocus
DoCmd.GoToRecord , , acNewRec

Me.sfrmTwo.SetFocus
DoCmd.GoToRecord , , acNewRec


Exit_cmdNew_Click:
Exit Sub

Err_cmdNew_Click:
MsgBox Err.Description
Resume Exit_cmdNew_Click
End Sub
 
M

missinglinq via AccessMonster.com

Why would you go to the trouble and aggravation of having subforms that only
hold option groups, instead of simply placing your option groups on the
tabbed pages themselves?
 
F

forcefield via AccessMonster.com

Hi,
In fact I have several tab pages for different group of people but similar
sets of option groups.
So I have several tables for different group of people linked to one main
table.
To lesson the complication, I just mentioned 2 pages. If someone can correct
my code for 2 pages, I add more codes for more pages.
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top