G
Gina
Hi
in my code for a garage frmWork is a subform of frmCar.
frmWork is based on a query, which takes as criteria frmCar.RegNum both are
linked via car registration number RegNum
RegNum and CustID are PK in the underlying tblCar
the easy part works fine
now, when a new car is added to an existing customer (or a new customer is
added together with a new car) I check whether the input in frmCar.RegNum is
valid.
therfore I wrote 2 (module) functions where first is counted the RegNum - if
is 0 - fine not already in db
if it is 1 then I check whether car is already registerd for that particular
customer - if 1 fine . (had to do this as I do the checking in the
before_update, after_update and the lost_focus event - user might click into
the RegNum field or pass it by via tab key)
problem is now that eventhough the number typed into the RegNum field is not
ok, the subform looks for the details of that car with the typed RegNum and
shows them.
1. how can I stop the frmWork from displaying the car's details when it's
not a correkt input (then I set it to carRegOK = false) ???
2. is it possible after my original setup of forms at all - criteria
field ???
3. am I using the right 3 events for the check of frmCar.RegNum field at
all ???
- well I have to do this check for not messing up the db!!
any help and idea highly appreciated
Gina
in my code for a garage frmWork is a subform of frmCar.
frmWork is based on a query, which takes as criteria frmCar.RegNum both are
linked via car registration number RegNum
RegNum and CustID are PK in the underlying tblCar
the easy part works fine
now, when a new car is added to an existing customer (or a new customer is
added together with a new car) I check whether the input in frmCar.RegNum is
valid.
therfore I wrote 2 (module) functions where first is counted the RegNum - if
is 0 - fine not already in db
if it is 1 then I check whether car is already registerd for that particular
customer - if 1 fine . (had to do this as I do the checking in the
before_update, after_update and the lost_focus event - user might click into
the RegNum field or pass it by via tab key)
problem is now that eventhough the number typed into the RegNum field is not
ok, the subform looks for the details of that car with the typed RegNum and
shows them.
1. how can I stop the frmWork from displaying the car's details when it's
not a correkt input (then I set it to carRegOK = false) ???
2. is it possible after my original setup of forms at all - criteria
field ???
3. am I using the right 3 events for the check of frmCar.RegNum field at
all ???
- well I have to do this check for not messing up the db!!

any help and idea highly appreciated
Gina