code on current on a form

Durien512

Registered User.
Local time
Today, 12:57
Joined
Dec 14, 2005
Messages
61
i have a subform within a form that i want to create and automated procedure.
the subform has a couple of combo boxes.

upon input into the subform i want to do something like if the value of combobox1 starts out with the letter B then the value of combobox3 equals combobox2 * 1/2
i am just having a hard time putting it in code.

as of now i have a on current event on the subform that reads

if me.[combobox1] like "b*" then
me.[combobox3] = me.[combobox2]*.05
end if

any help would be greatly appreciated!
 
Hello:
You would use something like the following code:
'
Private Sub Combobox1_AfterUpdate()
If Mid$(Combobox1, 1, 1) = "B" Then
Combobox3] = Combobox2*.05
End If
End Sub

I did not know what your using to fire this code, so I placed it in the AfterUpdate event of the Combobox1 control.
Regards
Mark
 

Users who are viewing this thread

Back
Top Bottom