help needed

R

richaluft

Hi!
I'm trying to use a form, frmINSURERCHANGE, to pass values to another
form. The Form, 'frmChangeInsurer', has two text box controls:
1)ClientID#
2)InsurerID#----------- where ID#'s go from 0 to n
the afterupdate event of the ClientID# field is as follows:private Sub Client_ID__AfterUpdate()

Dim MySql As String

MySql = "SELECT DISTINCTROW tblinsurers.[InsurerID#],
tblinsurers.InsurerName "
MySql = MySql & "FROM tblINSURANCEINFO INNER JOIN tblinsurers ON
tblINSURANCEINFO.[InsurerID#] = tblinsurers.[InsurerID#]"
MySql = MySql & "WHERE (((tblINSURANCEINFO.[clientID#])=[Forms]!
[frmChangeInsurer]![clientID#]));"

Me![InsurerID#].RowSource = MySql

End SubWhile the after update event works just fine for setting the
rowsource, my problem is that after this form is opened for use, I
find that the
underlying tblInsuranceInfo is updated with a NEW inappropriate row,
in which the clientID# is present along with an InsurerID# = 0,
nomatter
what the insurerID# was on the form.
I don't understand why this is happening, and I hope that someone can
explain what I've done wrong, and how to correct.

Thanks,
richard
 

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