Auto clean fields in linked objects

Hello everybody!

I am new in the Access world so i would really appreciate some help.

I am currently working on a main form in Access 2010 which includes quiet a lot of fields, therefore i choose to create parts of it (which are as well optional, as they do not apply to all records) as different forms which i linked to the "mother" form afterwards through a checkbox by using the following code:

Private Sub chkMajor2_Click()
Dim strformname As String
If Me.chkMajor2 = True Then
strformname = "Major 2"
DoCmd.OpenForm strformname, acNormal
End If

continued with..

If Me.chkMajor2 = True Then
chkMajor3.Visible = True
chkMajor3.Visible = False

End If

End Sub

to make the next form visible for selection after filling in the current one...something like an "add more.." field actually, which i choose to represent as checkbox. Please find bellow an image of it in case i didn't explain myself good.

The issue that i encounter is that when i click the "Add New" button in the main form, it doesn't clear also the fields in the linked forms. Is it possible to do that with a VBA code? Or how should i proceed?

The current code that i have for the button is:
Private Sub cmdNew_Click()
DoCmd.GoToRecord , , acNewRec
End Sub

Thank you in advance!


Alice VuapAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
i think you will have more control if you create a form with Tab Control or multiple pages.

see this link

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Alice VuapAuthor Commented:
Dear Rey,

Thank you for your reply. I've seen the Tab Control before but i don't find it that friendly. I would like to keep the extra fields in a pop up dialog. Is it any way that i can solve my problem while keeping it in the initial format?
Dale FyeOwner, Developing Solutions LLCCommented:
Agree with Rey that the "best" way to include additional data in a form, that is all tied to the same record is to use tab controls.
You could give one tab a caption like "Required" and the other tab a caption like "Optional".

Another issue is that you are going to have to save the current record before you open that second form, or you will end up with write conflicts when you attempt to close the popup form.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Alice VuapAuthor Commented:
ohh, i see! I didn't think of conflicts. I will give it a try then! Thank you both!
Rey Obrero (Capricorn1)Commented:
Welcome to EE..
Alice VuapAuthor Commented:
Thank u! :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.