Hello dear Jeff,
what to say...my database acted a little weird lately so I assume that all
the coding I have stuffed within the mainReservationForm
isn't helping finding the bugs. This is what I will do: clean up the
mainForm as well as the subForms and use as little code I need to achieve
what I want.
This mainForm holding the 2 subForms was getting a little too loaded with
automatisms. I think that restarting from scratch these Forms will help
debugging the errors.
I have something very important to ask you though that maybe can clear out
even more any mistakes at design-level I might have done and that are
causing the app to brake down and act funny. The application so far has
worked as planned but I am not sure if I have done things correctly.
I really need to understand if I have made some planning mistakes that will
bring the application in the future to don't work properly.
I said the app started behaving funny because beside the problem with the
Calendar, for example when I try to delete a record in the
mainReservationForm that HAS correlated fields in the two subForms Access
prompts its message to confirm the deletion (but without warning me that
there are correlated fields that will be deleted as well, which is what I
would expect), I confirm the deletion and when I open the
mainFormReservation again the record I deleted is still there...
??? If
I delete the same record from the table (tblReservation) source of the query
that feeds the mainFormReservation no problems at all...
To make it easier to understand let me explain what I have.
tblReservation 'is the spinal bone of the entier appl
IDReservation, intReservationNumber, dteReservation, ....., IDClient,
IDApartment, IDAgency ...so the reservation has a Client, Apartment, etc.
tblInvoices ' the table for invoices is very crucial since a Reservation
can have multiple invoices: one for deposit, one for balance...
IDInvoice, intInvoiceNumber, dteInvoiceDate, curAmount,.....IDReservation *
* !!! IMPORTANT !!! I include IDReservation here in tblInvoices so I can
have multiple Invoices for that Reservation but, is this correct?, is this
the right way to do it? In the relationships I have applied the Referential
Integrity plus checked the two options Cascade update and delete Related
Fields between tblReservation and tblInvoices. This because I want to
update/delete the invoice/invoices whenever I delete that Reservation.
The type of JOIN I have used is the OUTER since I can really select all the
records from both tables.
tblCleanings ' This is another crucial table in my appl
IDCleaning, intCleaningNumber, dteDateCleaning, ....., IDReservation
Here again I need to have multiple cleaning services for that one
Reservation but here for example I might also have cleanings not related to
any Reservation maybe just because a cleaning can be just for maintenance/
other. In fact in my app, from this table, has another Form independent
from this mainReservationForm to add cleaning services. To achieve this
result I have applied again the Referential Integrity and the Cascade update
and delete Related Fields but the type of Join here is a RIGHT-OUTER JOIN so
I can still have cleaning services not related to any Reservation but I can
still delete those cleaning services correlated to a Reservation. We may
apply the same rule to the above case for invoices, I might have in the
future to relate an invoice to other then Reservations, correct?
Ok the mainReservationForm is generated by the following:
qryReservation that is based on tblReservation plus the join with tblClients
and other tables such as tblApartments, tblAgencies...etc. From those
tables I only retrieve the values I need to address a client, an apartment,
an Agency to that reservation.
The first subForm is generated by tblInvoices. Here I can add/delete as
many invoices for that IDReservation.
The second subForm generated by tblCleanings and functions same as above.
On a testing database this works fine but I ask you if this is formally
correct or there is another method to achieve this.
With this scenario will I encounter problems or it is correct and I should
keep working on like this? If this is the case then I will just clean up
the mainReservationForm and keep it simple so that I will eradicate the
possible bugs and I am sure I will not encounter the errors for the Calendar
and the show/hide buttons....
If I am doing something completely wrong please point it out to me so I can
start working in the right direction. I am thinking of many-to-many
relationships ... Am I in one of those cases? Do I need to create a
"Junction Table". If I do please let me know where to find tutorials on
this. I am not too familiar with it.
What to say Jeff, if you have got so far reading my long, long call for help
you are a Saint now...!
Lorenzo
Do you plan to come Florence ???