Avoid Saving a Record

  • Thread starter Thread starter ManuPR
  • Start date Start date
M

ManuPR

Hi,

Is there a way to avoid saving a record when moving the focus from a main
form to a subform?

I have a main form that has data related to a doctor appointment and a
subform that has the criteria the patient needs to meet before being able to
book the appointment. The problem is that I don't want to save the
appointment record until the criteria is checked in the subform but when I
move the focus to the subform the record is automatically saved. The criteria
has to be in a subform because it can change from doctor to doctor.
 
a easy method would be to use dao recordsets and not use bound objects
but you woudl haev to do some research on how to write code for dao

hope this helps

Regards
Kelvan
 
No. You can't do that.

Assuming you have set up a one-to-many relationship between the main form's
table and the subform's table, the subform needs the primary key value from
the main form for it's record. You can't save the subform record that
relates to the main form record until after the main form record exists.
Therefore you cannot use anything about the related record as a condition
for accepting the main form record. Chicken'n'egg problem.
 
Back
Top