NEW record, another table, using Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have developed a Books Inventory database containing three tables, Authors,
Publishers, and Books. I have developed three Forms, one for each table.
When I am entering records using the Books' form, is it possible to enter a
new record in Pulishers' table using this form?

Also, is the three forms option for the tables the easiest way to enter
records in them?

phm
 
Not using that form, but you could have a button that pops-up the
appropriate form.

If you are selecting the publisher from a drop-down list, there is also some
fancy coding you could do using the "not in list" event to have a form pop
up for you and allow you to add a publisher.

You might be able to use subforms to do all of this on one form, but I doubt
it. Personally I think the three forms option (with buttons to "add a
publisher" or "add an author" on your main form) is the best design from
what little you have described.

Good luck,

Rick B
 
Hi Rick B,

Thank you for letting me know that 'three tablses and three forms is the
better way to go. And, the popup seems to be the way for adding new records.
However, what would be the code behind the button to "add a Publisher" or
"add an Author" from the Books form?

Thanks!

phm
 
There is some code to get you started at
http://www.mvps.org/access/forms/frm0015.htm

You'll need versions of that code in the NotInList Event of the Publishers
and Authors comboboxes
in that code, just after rs.update, put in something like

DoCmd.OpenForm("frmAuthor"), ... ,acDialog

Look in Help for the OpenForm Method and read about it. Put in a comma for
each missing parameter. You want to open the form in Dialog mode so that
nothing else can go on in your application until the record has been
completed and you have closed the form.

You'll also want to be sure that you have set the Limit to List property
true in each combobox.

HTH
 
Back
Top