Wiz47
Learning by inches ...
- Local time
- Today, 09:12
- Joined
- Nov 30, 2006
- Messages
- 274
I have a private sub that is somewhat repetitive and want to add variables to lighten the code. The original code looks like this:
This works fine on the Afterupdate Event
But when I attempt the code below, it doesn't execute. I think I might be declaring the variables incorrectly. Cbo_Mult_B1 is a Combobox and Txt_B_Fat_1 is a textbox that accepts an integer
Any help would be appreciated.
Code:
If Me.Cbo_Mult_B1 = "2" Then Me.Txt_B_Fat_1 = Nz(Me.Txt_B_Fat_1, 0) * 2
This works fine on the Afterupdate Event
But when I attempt the code below, it doesn't execute. I think I might be declaring the variables incorrectly. Cbo_Mult_B1 is a Combobox and Txt_B_Fat_1 is a textbox that accepts an integer
Code:
Private Sub Cbo_Mult_B1_AfterUpdate()
Dim First_Box as String
Dim Second_Box as integer
First_box = Me.Cbo_Mult_B1
Second_Box = Me.Txt_B_Fat_1
If First_box = "2" Then Second_Box = Nz(Second_Box, 0) * 2
End Sub
Any help would be appreciated.
Last edited: