R
Ray C
I have four combo Boxes Box_1, Box_2, Box_3 and Box_4. I want to set the
default value to some data as part of the After_Update event.
The cumbersome way to do it would be to have 4 individual sub routines to
handle I want to do a whole host of other things that would be the same in
each routine and a whole raft of code would be repeated for each Box Routine.
I have tried setting up the following bit I can not get it to work, any help
would be appreciated.
Private Sub Box_1_AfterUpdate(NewData as String)
Call BoxDefaultRoutine(NewData, 1)
End Sub
Rem This routine would be repeated for each of the other three boxes where
the number 1 would be changed to number 2, 3, or 4
Private Sub BoxDefaultRoutine(NewData as string, BoxNumber)
Dim BoxName as Control
Rem Other bits of code
BoxName = "Box_" & BoxNumber
me.BoxName.DefaultValue - """" & newDAta & """"
Rem More Code
End Sub
I have tried rapping BoxName in Parenthasis, tried seting it as a String and
a number of other odd variations but to no avail. Sorry if my attempt to
explain this is poor but I hope that you understand what I am trying to do.
Thanks Ray C
default value to some data as part of the After_Update event.
The cumbersome way to do it would be to have 4 individual sub routines to
handle I want to do a whole host of other things that would be the same in
each routine and a whole raft of code would be repeated for each Box Routine.
I have tried setting up the following bit I can not get it to work, any help
would be appreciated.
Private Sub Box_1_AfterUpdate(NewData as String)
Call BoxDefaultRoutine(NewData, 1)
End Sub
Rem This routine would be repeated for each of the other three boxes where
the number 1 would be changed to number 2, 3, or 4
Private Sub BoxDefaultRoutine(NewData as string, BoxNumber)
Dim BoxName as Control
Rem Other bits of code
BoxName = "Box_" & BoxNumber
me.BoxName.DefaultValue - """" & newDAta & """"
Rem More Code
End Sub
I have tried rapping BoxName in Parenthasis, tried seting it as a String and
a number of other odd variations but to no avail. Sorry if my attempt to
explain this is poor but I hope that you understand what I am trying to do.
Thanks Ray C