R
richaluft
I'm trying to use a form "ReferrerChangeSelect" to call for a revision
of 'referrer' data for clients. The form has two controls:
1) Client ID#
2) Referrer
The AfterUpdate event of the Client ID# control is:
Dim MySQL As String
MySQL = "SELECT DISTINCTROW QReferrersUnion.[Ref#],
QInsurersUnion.RefName "
MySQL = MySQL & "FROM ReferrerINFO INNER JOIN QReferrersUnion ON
ReferrerINFO.[Ref#] = QReferrersUnion.[Ref#]"
MySQL = MySQL & "WHERE ((ReferrerINFO.[client ID#] = "
MySQL = MySQL & "[Forms]![FReferrerChangeSelect]![client ID#]));"
Me![Referrer].RowSource = MySQL
Dim MySQL As String
MySQL = "SELECT DISTINCTROW QInsurersUnion.[Ref#],
QInsurersUnion.InscoName "
MySQL = MySQL & "FROM INSURANCEINFO INNER JOIN QInsurersUnion ON
INSURANCEINFO.[Ref#] = QInsurersUnion.[Ref#]"
MySQL = MySQL & "WHERE ((INSURANCEINFO.[Client ID#] = "
MySQL = MySQL & "[Forms]![FInsurerChangeSelect]![Client ID#]));"
Me![Referrer].RowSource = MySQL
(Note that the reason for the union query is to include the
possibility of NO referrer for the client, so that the refID# for NO
referrer =0, and
there is no name, address, etc for the non-person in the union table.)
The problem that I'm having is as follows: when this form is opened
and the clientID# control is updated, (even before I have moved
focus to the Referrer control) I find that I'm getting an automatic
update in my ReferrerINFO table, where the client now appears
listed twice: once with the original referrer, and a second time with
RefID# = 0.
This is, of course, inappropriate, and I'm wondering if I have to re-
design the whole updating procedure, or whether there is
something simple that can be done to prevent this inappropriate entry
into the underlying table
of 'referrer' data for clients. The form has two controls:
1) Client ID#
2) Referrer
The AfterUpdate event of the Client ID# control is:
Dim MySQL As String
MySQL = "SELECT DISTINCTROW QReferrersUnion.[Ref#],
QInsurersUnion.RefName "
MySQL = MySQL & "FROM ReferrerINFO INNER JOIN QReferrersUnion ON
ReferrerINFO.[Ref#] = QReferrersUnion.[Ref#]"
MySQL = MySQL & "WHERE ((ReferrerINFO.[client ID#] = "
MySQL = MySQL & "[Forms]![FReferrerChangeSelect]![client ID#]));"
Me![Referrer].RowSource = MySQL
Dim MySQL As String
MySQL = "SELECT DISTINCTROW QInsurersUnion.[Ref#],
QInsurersUnion.InscoName "
MySQL = MySQL & "FROM INSURANCEINFO INNER JOIN QInsurersUnion ON
INSURANCEINFO.[Ref#] = QInsurersUnion.[Ref#]"
MySQL = MySQL & "WHERE ((INSURANCEINFO.[Client ID#] = "
MySQL = MySQL & "[Forms]![FInsurerChangeSelect]![Client ID#]));"
Me![Referrer].RowSource = MySQL
(Note that the reason for the union query is to include the
possibility of NO referrer for the client, so that the refID# for NO
referrer =0, and
there is no name, address, etc for the non-person in the union table.)
The problem that I'm having is as follows: when this form is opened
and the clientID# control is updated, (even before I have moved
focus to the Referrer control) I find that I'm getting an automatic
update in my ReferrerINFO table, where the client now appears
listed twice: once with the original referrer, and a second time with
RefID# = 0.
This is, of course, inappropriate, and I'm wondering if I have to re-
design the whole updating procedure, or whether there is
something simple that can be done to prevent this inappropriate entry
into the underlying table