Timing of updates to form fields

A

Abay

Hello .. I have two different combo boxes on my form with some additional
code which behave differently on the "After Update" property.

Sample 1

Private Sub Make_combo_AfterUpdate()
Me!Warranty_agent = Me!Make_combo.Column(2)
Me!Warranty_code = Me!Make_combo.Column(1)
Me!Print_auth = Me!Make_combo.Column(3)
If Status = "WO" Or Status = "DONE" Then
Me!Notes = Me!Make & " " & Me!Unit & " - "
Me!Notes = Me!Notes & " CONTACT: " & Forms!FClient_and_sub!Contact_1 & " "
& Forms!FClient_and_sub!Contact_tel_1 & " "

End If

The fields in question are updated when I go forward to a subsequent field
on the form
*****************************
Sample 2

Private Sub Combo221_AfterUpdate()

Me!Unit = Me!Combo221.Column(1)
Me!Make = Me!Combo221.Column(2)
Me!Model = Me!Combo221.Column(3)
Me!Serial_no = Me!Combo221.Column(4)

If Status = "WO" Or Status = "DONE" Then
Me!Notes = Me!Make & " " & Me!Unit & " - "
Me!Notes = Me!Notes & " CONTACT: " & Forms!FClient_and_sub!Contact_1 & " "
& Forms!FClient_and_sub!Contact_tel_1 & " "
End If

Combo129.SetFocus

The Unit, Make, Model and Serial_no fields are not updated when the focus is
set back to a previous field (Combo129) but the Update to the "Notes" fields
takes place ... the other fields are updated when I advance to a new record.
*************************************
Is there a way to force Access to update fields regardless of the direction
of the "SetFocus" command.

Also I find that if I go back subsequently and change data in either of the
Combo boxes I have to exit the form for the updates to take place ... am I
doing something really stupid?

Note: I tried adding the code to the "On Change" property, with no success
... did more or less the same thing.

Learning as I go .. any help would be much appreciated.

Abay
 

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