Command Button on form

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

Guest

Help! I have 2 tables, project and invoice. Invoice has a foreign key pointing back to Project because I would like to issue multiple invoices per project. I have a button on the project form to open the invoice form to create a new invoice. Here's my problem. When I open the invoice form I am able to create a new invoice form, but when I go back and look at the invoice table, it has a 0 under the project id field. i thought I had this figured out but I'm obviously missing some code. Can anyone help? Please? :-)
 
debraj007 said:
Help! I have 2 tables, project and invoice. Invoice has a foreign key pointing
back to Project because I would like to issue multiple invoices per project. I
have a button on the project form to open the invoice form to create a new
invoice. Here's my problem. When I open the invoice form I am able to create a
new invoice form, but when I go back and look at the invoice table, it has a 0
under the project id field. i thought I had this figured out but I'm obviously
missing some code. Can anyone help? Please? :-)
 
You have independent forms where you need a form and a subform. Base the main
form on your projects table and the subform on your invoice table. Set the
linkMaster and LinkChild properties of the subform control on the main form to
ProjectID. Each time you create an invoice, ProjectID will be automatically
entered in the subform.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com


debraj007 said:
Help! I have 2 tables, project and invoice. Invoice has a foreign key pointing
back to Project because I would like to issue multiple invoices per project. I
have a button on the project form to open the invoice form to create a new
invoice. Here's my problem. When I open the invoice form I am able to create a
new invoice form, but when I go back and look at the invoice table, it has a 0
under the project id field. i thought I had this figured out but I'm obviously
missing some code. Can anyone help? Please? :-)
 
Yes!

Start by creating a form/subform for your invoices and invoice details. Base the
main form on your invoicess table and the subform on your invoice details table.
Set the linkMaster and LinkChild properties of the subform control on the
invoice form (main form) to InvoiceID. Each time you create an invoice,
InvoiceID will be automatically entered in the subform.

Once you have the above, create a form/subform for your projects and invoices.
Base the main form on your projects table. With the projects form in design
view, click on Windows - Tile Vertically on the menu bar at the top of the
screen. Click and drag your invoice form in the right pane and drop it in the
Details section of your project form in the left pane. Click on the subform
control in the projects form to be sure the LinkMaster and LinkChild properties
are set to ProjectID.

Now when you navigate from project to project, you should see the first invoice
for that project along with the invoice details for that invoice. You should be
able to navigate from invoice to invoice for the same project and see the
corresponding details for each invoice.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com
 
Back
Top