P
Piri
Access 2007
I have a series of unbound combo list boxes on a data input form:
Material01
Material02
Material03 etc - up to 10
One of the items listed is "Other"
When the operator selects "Other" I would like them to enter a
description in an existing unbound text box alongside the Combo list.
These text boxes are named MaterialDesc01, 02, 03 etc to 10
I have created a small pop-up form for the user to enter that
description so I can apply rules to the input, which is stored as a
variable for inserting into the appropriate text field.
Rather that writing a procedure for each combo AfterUpdate event I was
looking to be able to recycle the same bit of module code that
identified the active combo, extracted the number from the end of its
name (01,02,03 etc) and used that to identify the text field into
which to insert the description string.
So far I have
Set ctlCurrentControl = Screen.ActiveControl
strControlName = ctlCurrentControl.Name ' this gives me the active
control okay
ControlIDNo = Right(strControlName, 2) 'this gives me the active
combo number - ControlIDNo is a string variable
What I would like to be able to do is reference the text box
MaterialDesc of the same number in the form so I can insert the string
from the user input form.
I have tried using a Select Case statement to match combo to text box
but still cannot get it to work.
If I can do this I can use this method in other areas of my project.
Any help gratefully appreciated.
Piri
I have a series of unbound combo list boxes on a data input form:
Material01
Material02
Material03 etc - up to 10
One of the items listed is "Other"
When the operator selects "Other" I would like them to enter a
description in an existing unbound text box alongside the Combo list.
These text boxes are named MaterialDesc01, 02, 03 etc to 10
I have created a small pop-up form for the user to enter that
description so I can apply rules to the input, which is stored as a
variable for inserting into the appropriate text field.
Rather that writing a procedure for each combo AfterUpdate event I was
looking to be able to recycle the same bit of module code that
identified the active combo, extracted the number from the end of its
name (01,02,03 etc) and used that to identify the text field into
which to insert the description string.
So far I have
Set ctlCurrentControl = Screen.ActiveControl
strControlName = ctlCurrentControl.Name ' this gives me the active
control okay
ControlIDNo = Right(strControlName, 2) 'this gives me the active
combo number - ControlIDNo is a string variable
What I would like to be able to do is reference the text box
MaterialDesc of the same number in the form so I can insert the string
from the user input form.
I have tried using a Select Case statement to match combo to text box
but still cannot get it to work.
If I can do this I can use this method in other areas of my project.
Any help gratefully appreciated.
Piri