help needed

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.[patient ID#] = "
MySQL = MySQL & "[Forms]![FReferrerChangeSelect]![patient ID#]));"

Me![Referrer].RowSource = MySQL
Dim MySQL As String

MySQL = "SELECT DISTINCTROW QInsurersUnion.[Insco#],
QInsurersUnion.InscoName "
MySQL = MySQL & "FROM INSURANCEINFO INNER JOIN QInsurersUnion ON
INSURANCEINFO.[Insco#] = QInsurersUnion.[Insco#]"
MySQL = MySQL & "WHERE ((INSURANCEINFO.[patient ID#] = "
MySQL = MySQL & "[Forms]![FInsurerChangeSelect]![patient ID#]));"

Me![ChangeWhat].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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top