A1VBCode Forums

Access 2003 - Code does not force equal values in two text boxes


http://www.a1vbcode.com/vbforums/Topic27284.aspx

By Barry - 3/20/2009

I have converted a macro to VBA because I was getting an error message that "Echo=Off" or "Setwarnings=No" could neither suppress.  I then changed the "On Error GoTo" line set to "0", which resolved the error message problem.  Now, though, it does not force the Well Location value to equal that of the value in Comb box 34 (Combo34) any longer.  Anyone know what I may add to the script (below) to force the Well Location value to equal what is visible (selected) in the combo box?

Function Forms_UpdateWellID()
On Error GoTo 0

    DoCmd.Echo False, ""
    DoCmd.SetWarnings False
    ' Updates new Well Location record in frmWellMaintenanceSub based on what is visible in Combo box 34
    Forms!frmWellMaintenance!frmWellMaintenanceSub.Form![Well Location] = Forms!frmWellMaintenance!Combo34


Forms_UpdateWellID_Exit:
    Exit Function

End Function