View Full Version : If Then Statement Based on Combobox


Kroghr
04-23-2010, 05:39 PM
Can someone please tell me why this will not work?

Me.Destination is a combobox with values of KWA ROI MAJ WAK
TxtTOTALWEIGHT is Unbound Calculated field
Me.TxtMAXWEIGHT is Unbound Text box


Private Sub TxtTOTALWEIGHT_AfterUpdate()
If Me.Destination = "KWA" Or Me.Destination = "ROI" Then
Me.TxtMAXWEIGHT = "14200"
Else
If Me.Destination = "MAJ" Or Me.Destination = "WAK" Then
Me.TxtMAXWEIGHT = "14500"
End Sub

Steve R.
04-23-2010, 06:24 PM
I think you need to place the subroutine into the "on click event".

Before moving the function, test it out with the debug.print command to see what you are getting as a result. Move to the "on click event" and recheck.