L
Lorenzo
Hello Everyone!
I have a little complicated structure (at least for me !) and I would
appreciate any help.
The DB serves to track invoicing in two different directions. It is the
same company and it follows the same invoicing number which I handle thanks
to a function and not through the Autonumber field.
Until today I have developed the DB with in mind keeping the tblReservation
as the "one" part of the "one to many" relationship. I have a main form
from which I insert reservations. The sources for this main form are the
following tables:
The main table has the following structure:
tblReservation, IDReservation, dteReservation, dteArrival,
dteDeparture...etc...IDApartment
The first subMask is generated by the following table
tblInvoices, IDInvoice, dteInvoice, strNumberInvoice (which is
autoincrementing thanks to a function I call each time I want to add an
invoice #)
IDReservation, blnDwPayment, blnBalance, ....etc....
I have done so I can have more than one invoice for each reservation since I
have one invoice for downpayment and one for balance but all related to that
Reservation ID. Important: I want to prevent deleting the Invoices in case
I cancel a reservation though.
The second subMask relates to the cleaning services table so:
tblCleaning, IDCleaning, dteCleaning, intHours, .....etc...IDReservation
again here I have done so I can have multiple cleaning services for that
reservations.
The problem
I have come to te point I was adding another new from that handles invoicing
for offices rents. I wanted to use the same tblInvoice since I need to have
the same invoicing number. With my DB structured like this I am not able to
accomplish it because if I want to insert an "extra invoice" the Integrity
reference won't let me add any record to the tblInvoice unless I have a new
reservation as well. For the same reason I am not able to add to my DB a
new form for general cleaning services not depending from Reservations again
here I have the IDReservation in the cleaning tables that asks for its
related number.
Any help?
Thank you in advance.
Lorenzo
I have a little complicated structure (at least for me !) and I would
appreciate any help.
The DB serves to track invoicing in two different directions. It is the
same company and it follows the same invoicing number which I handle thanks
to a function and not through the Autonumber field.
Until today I have developed the DB with in mind keeping the tblReservation
as the "one" part of the "one to many" relationship. I have a main form
from which I insert reservations. The sources for this main form are the
following tables:
The main table has the following structure:
tblReservation, IDReservation, dteReservation, dteArrival,
dteDeparture...etc...IDApartment
The first subMask is generated by the following table
tblInvoices, IDInvoice, dteInvoice, strNumberInvoice (which is
autoincrementing thanks to a function I call each time I want to add an
invoice #)
IDReservation, blnDwPayment, blnBalance, ....etc....
I have done so I can have more than one invoice for each reservation since I
have one invoice for downpayment and one for balance but all related to that
Reservation ID. Important: I want to prevent deleting the Invoices in case
I cancel a reservation though.
The second subMask relates to the cleaning services table so:
tblCleaning, IDCleaning, dteCleaning, intHours, .....etc...IDReservation
again here I have done so I can have multiple cleaning services for that
reservations.
The problem
I have come to te point I was adding another new from that handles invoicing
for offices rents. I wanted to use the same tblInvoice since I need to have
the same invoicing number. With my DB structured like this I am not able to
accomplish it because if I want to insert an "extra invoice" the Integrity
reference won't let me add any record to the tblInvoice unless I have a new
reservation as well. For the same reason I am not able to add to my DB a
new form for general cleaning services not depending from Reservations again
here I have the IDReservation in the cleaning tables that asks for its
related number.
Any help?
Thank you in advance.
Lorenzo