Form not being created as a new record

I have a form which contains 3 subforms.  On the main form is a combobox field and the default value of the combobox field is:

=DLookUp("EmpN","LOCALtblCurrentUser")

The first thing a user does is attempt to make an entry in one of the subforms.  But because the user doesn't actually do anything with the main form (unless they select a different username from the combobox), they get an error because the main form record hasn't actually been created.  In other words it doesn't have a record number yet.

What I need to do it "trick" the main form into creating a record once the user focuses on the subform.

How can this be done?


--Steve
SteveL13Asked:
Who is Participating?
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.

Jeffrey CoachmanMIS LiasonCommented:
So the combobox controls the link to the subform?
So are you saying that the use "must" make an selection from the combobox first *then* be allowed to enter the subform...?

If so, then you can disable the subform when the main form opens, then only turn it on when a selection is made in the main form combobox.

- Set the Enabled propety of the *subform* to: NO

- Then put code like this on the combobox's after update event
    If me.YourCombobox<>"" or Not isnull(YourCombobox) then
        me.Yoursubform.Enabled=True
    end if

Not sure if I am understanding this correctly, ...so give it a try, ..and lets also see what other experts post.


JeffCoachman
0

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
Jeffrey CoachmanMIS LiasonCommented:
;-)
0
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.