Open Main form and subforms in new form mode

G

Guest

I need help to figure out how I can build a Mainform (called CreateNewRule)
that contains approx 7 subforms and have them all ready to accept new data
when a user opens the form. I do not want to show any existing records as I
will build a separate form for that.

Currently "CreateNewRule" form is built from a table "RuleID" This main
table houses the primary key "Rule_ID" that is found in all the other tables
so that I could set up one-to-many relationships. Each table is built for
different criterentia of the main rule.

Each subform is built using the smaller tables that again have the
one-to-many relationship to the main table. This part works because if I set
the Main form and subforms to show existing records, all the data is sync'd.

What I am trying to do is create the main form to open in a data entry mode
(data entry set to "yes") and have all the subforms also open to data entry
also. My problem is the main form opens to a new form to fill out (which is
good), but all my subforms are blank. I have the subforms set to be in a
datasheet view so I could simply copy and paste a large amount of data into
them. When the Main form opens, my subforms have all the column headings but
no place for me to enter in the data. It looks like a spreadsheet with no
rows.

I have checked the data entry to YES on all the subforms to no avail but I
fear it must be more difficult than this???

I am relatively new to coding so I wil tell you upfront it might take some
Q&A to help me figure out how to code correctly and where to find the right
name of the subform if I need to do some coding but I am willign to learn!
Thank you!
 
G

Guest

grasshopper,

I assume you have a button somewhere that you are using to open the form.
Try using the code below in the OnClick event of that button:

DoCmd.OpenForm "YourFromNameHere", , , , acFormAdd

This will open your form to a new record, ready for you to enter the data.
You do not need to set the DataEntry to Yes so just set it back to No.
 

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