F
Fao, Sean
Hello All,
I have a form with a field that I would like to get filled in automatically
with the same value as another field on the table. These two fields are
linked through a relationship. What I have done to have the value filled in
automatically is place the following code on the "On Lost Focus" event of
one of the two related fields:
<CODE_SNIP>
[Forms]![frmQuoteMaster]![tblQuoteDetail Subform].Form![QuoteNumber] =
QuoteNumber
</CODE_SNIP>
This works, however I get this error message (I'm guessing before my code
has a chance to run) "You cannot add or change a record because a related
record is required in table 'tblQuoteMaster'." After I click 'Ok', my code
is run and the value is filled in properly.
Is this just Access warning me of the relationship between the two fields?
If so, is there any way I can ignore it since I'm correcting the error as
soon as it's done checking. I've tried adding an "On Error Resume Next" to
my code to no avail.
Quite honestly, I'm not sure why I need to have the value filled in anyway.
I was under the impression that the relationship would cause the value to be
automatically filled in without the need of code. If that were the case, I
apparently have something else wrong.
I appreciate any advice and thank you all in advance,
Sean
I have a form with a field that I would like to get filled in automatically
with the same value as another field on the table. These two fields are
linked through a relationship. What I have done to have the value filled in
automatically is place the following code on the "On Lost Focus" event of
one of the two related fields:
<CODE_SNIP>
[Forms]![frmQuoteMaster]![tblQuoteDetail Subform].Form![QuoteNumber] =
QuoteNumber
</CODE_SNIP>
This works, however I get this error message (I'm guessing before my code
has a chance to run) "You cannot add or change a record because a related
record is required in table 'tblQuoteMaster'." After I click 'Ok', my code
is run and the value is filled in properly.
Is this just Access warning me of the relationship between the two fields?
If so, is there any way I can ignore it since I'm correcting the error as
soon as it's done checking. I've tried adding an "On Error Resume Next" to
my code to no avail.
Quite honestly, I'm not sure why I need to have the value filled in anyway.
I was under the impression that the relationship would cause the value to be
automatically filled in without the need of code. If that were the case, I
apparently have something else wrong.
I appreciate any advice and thank you all in advance,
Sean