New record saved with no record on child form (1 Viewer)

jdcallejas

Registered User.
Local time
Today, 12:30
Joined
Jul 1, 2008
Messages
108
Hello,

I have an issue with my DB. I created a form from different tables.

Lets say I have a Client Table, Invoice Table, InvDetail Table and a Product Table.

Relationships are;

One to Many from Client to Invoice, Many to Many from Invoice to invoice Detail, Many to Many from Invoice Detail to Products.

On the Inv Detail table I have two Primary Keys, InvoiceID and ProductID.

Now when I go to create an invoice I select the date and the client and the product. This works fine....

Now if I create an invoice and select the Date, Cleint and save the record it will save the record without any products!!!... I thought it was necesary to have both primary keys releated on the InvDetail table for it work...

Ok my question is how can I make it so that the users cant make null invoices, I mean invoices without products..?

Ok, now, I used the product example because thats how I figured out how to do what I needed to do... I have attached my real DB...

Its about Landlord Management, so I did the following:

Apartments = Clients, Invoices= Leases, InvDetail=LeaseDetail and Products=Tenants.






Thanks,

Daniel...
 

Attachments

  • RentaMax1.zip
    112.2 KB · Views: 95

James Dudden

Access VBA Developer
Local time
Today, 17:30
Joined
Aug 11, 2008
Messages
369
You could test for a null value in the ProductID on either the BeforeInsert of the form or BeforeUpdate of the Client and Date. Then you could put up a messagebox telling them to select a product first. Or you could set a validation rule.
 

Users who are viewing this thread

Top Bottom