G
ghotion
I'm using Access 2000 on XP
I have a main form (Form A) and a subform (Subform B). The main form
is associated with Table A, the subform is associated with Table B (a
set of dates). For example, Table A contains the fields: AID, ANAME,
AINFO. Table B contains BID, AID, BDATE, linking to table A via AID.
Normally, to make a change I search for a particular ANAME, then
update AINFO, and add a new record in Table B (via Subform B) with
BDATE in the future. I then search for another ANAME, etc. The problem
is, I sometimes forget to add the new record in table B before going
to the new record.
I wrote some Public VBA code in Subform B that would look to be sure
that its recordset has a future date, and that works OK. Initially, I
put some code into Form A at the "Before Update" event that would call
that routine. It works, but the problem is that I get my error
immediately after changing Table A and moving my focus to subform B,
before I even get a chance to add the record via the subform.
So, what I would like to do is to perform my check only if I attempt
to get a new record (via search or any other way) for table A. I.e.,
when I think I am done with all my updates for those associated
records - not when moving in and out of subforms. Is there an event
that I can use? Any suggestions?
Tom
I have a main form (Form A) and a subform (Subform B). The main form
is associated with Table A, the subform is associated with Table B (a
set of dates). For example, Table A contains the fields: AID, ANAME,
AINFO. Table B contains BID, AID, BDATE, linking to table A via AID.
Normally, to make a change I search for a particular ANAME, then
update AINFO, and add a new record in Table B (via Subform B) with
BDATE in the future. I then search for another ANAME, etc. The problem
is, I sometimes forget to add the new record in table B before going
to the new record.
I wrote some Public VBA code in Subform B that would look to be sure
that its recordset has a future date, and that works OK. Initially, I
put some code into Form A at the "Before Update" event that would call
that routine. It works, but the problem is that I get my error
immediately after changing Table A and moving my focus to subform B,
before I even get a chance to add the record via the subform.
So, what I would like to do is to perform my check only if I attempt
to get a new record (via search or any other way) for table A. I.e.,
when I think I am done with all my updates for those associated
records - not when moving in and out of subforms. Is there an event
that I can use? Any suggestions?
Tom