Hi to all!
I have a pretty complex problem with a form and a subform and I really can't think what to do...
First of all, the main form keeps appointments. The screenshot form1.jpg shows the main form with an appointment from the client named KAPEZA TATIANA (not a real person ;o) ), the employee who will be responsible of meeting her and the arranged date and time on 23 Jan 08 at 08:00.
After the end of the appointment, the employee will re-open the form, find the same appointment and add the info that the client bought a product (serum sublime shine blablabla) for 10 euros (as shown in the subform of form1.jpg). This subform updates a table named CHARGES which has 4 fields: CLIENT_ID, CHARGES_ID, DATE and AMOUNT. The 3 first fields are Combined Primary Keys.
I have already connected the 2 forms with secondary field connection being CLIENT_ID and DATE (which I hide from viewing because there is no user input needed there), so that when I choose a client and a date from the main form, the values for CLIENT_ID and DATE will be passed automatically at the sub form's appropriate fields, (which I also hide from viewing).
Now, suppose the client comes at a later hour (such as 08:15, as shown in form2.jpg) or even at a later day/date, a new appointment will be arranged, and I want the main form to contain the NEW appointment's data (the clients full name, the employee responsible to meet him/her, the date and the time) and the subform to contain the NEW purchases' data (which obviously will be filled in by the database's user).
The problem is that if I add the new appointment, with the same client, the same employee, the NEW date and time, the subform (at the exact moment when I select the date) gets filled in with the purchases from the previous (chronologically) appointment. If I (dare to) erase the old purchases, then the previous appointment is affected.
Is there a way to keep sending the CLIENT_ID and DATE values from the form to the subform automatically (as I already do) but to force the subform to clear the old data (without erasing it, of course) and accept the new data for the purchases of the new appointment? I hope I explained my problem clearly.
Thanks in advance
Alexander
I have a pretty complex problem with a form and a subform and I really can't think what to do...
First of all, the main form keeps appointments. The screenshot form1.jpg shows the main form with an appointment from the client named KAPEZA TATIANA (not a real person ;o) ), the employee who will be responsible of meeting her and the arranged date and time on 23 Jan 08 at 08:00.
After the end of the appointment, the employee will re-open the form, find the same appointment and add the info that the client bought a product (serum sublime shine blablabla) for 10 euros (as shown in the subform of form1.jpg). This subform updates a table named CHARGES which has 4 fields: CLIENT_ID, CHARGES_ID, DATE and AMOUNT. The 3 first fields are Combined Primary Keys.
I have already connected the 2 forms with secondary field connection being CLIENT_ID and DATE (which I hide from viewing because there is no user input needed there), so that when I choose a client and a date from the main form, the values for CLIENT_ID and DATE will be passed automatically at the sub form's appropriate fields, (which I also hide from viewing).
Now, suppose the client comes at a later hour (such as 08:15, as shown in form2.jpg) or even at a later day/date, a new appointment will be arranged, and I want the main form to contain the NEW appointment's data (the clients full name, the employee responsible to meet him/her, the date and the time) and the subform to contain the NEW purchases' data (which obviously will be filled in by the database's user).
The problem is that if I add the new appointment, with the same client, the same employee, the NEW date and time, the subform (at the exact moment when I select the date) gets filled in with the purchases from the previous (chronologically) appointment. If I (dare to) erase the old purchases, then the previous appointment is affected.
Is there a way to keep sending the CLIENT_ID and DATE values from the form to the subform automatically (as I already do) but to force the subform to clear the old data (without erasing it, of course) and accept the new data for the purchases of the new appointment? I hope I explained my problem clearly.
Thanks in advance
Alexander