subForm Not Adding Record

R

Ripper

I have a subForm that has all of its fields populated with default vaules
from the Main form (=[form1]![Field1]). No problem, I can get those to fill
in, when I attempt to save that record, into another table, Access will not
write the record. The AutoNumber field is still says <AutoNumber>. If I
click in a field and change the value, the auto number creates a record and
away we go. No problem.

I tried using a button with the doCmd.RunCommand acCmdSaveRecord, to no
avail, and I tried using the button wizard write this:
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Nothing there either. I can't use the goto New Record because I need the
information in the DhallID field in the Where condition on an OpenReport code.

The only thing that works is if I change a value on the subform and hit TAB.
the Autonumber populates and the record saves with the save command above
and the report that is tied to a DhallID is printed.

How do I get the button to save the record when the <AutoNumber> doesn't
populate until I change some information on the subForm?
 

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