David Mack
Registered User.
- Local time
- Today, 20:17
- Joined
- Jan 4, 2000
- Messages
- 53
Hi,
I have spent the past few days working on a form on-the-fly which is a questionaire. I have been able to add labels, option groups, (what a challenge that was) and other controls with a little sweat. Now I'm stuck. I have been trying to assign a function or subprocedure contained in a module to the OnClick event of a control via code. I have tried just about everything. How is it done? It's not in any of my developer books or in the help facility that I can find.
The snipet of code:
Set optAnswer = CreateControl("frmOptions", acOptionGroup, , "", "", left, top)
With optAnswer
.ControlSource = i
.DefaultValue = 3
.Name = "option" & i
.Height = 300
.Width = 1700
'Handle nulls passed by the array...
.Tag = IIf(IsNull(arrayrst(5, i - 1)), "", arrayrst(5, i - 1))
.ControlTipText = IIf(IsNull(arrayrst(4, i - 1)), "", arrayrst(4, i - 1))
.OnClick '''''''WHAT GOES HERE?''''''''
End With
The form is programically created and opened up in acDesign mode. All the other properties seem to set fine. Do I have to set the "Contains Module" property first maybe?
Thanks,
Dave
I have spent the past few days working on a form on-the-fly which is a questionaire. I have been able to add labels, option groups, (what a challenge that was) and other controls with a little sweat. Now I'm stuck. I have been trying to assign a function or subprocedure contained in a module to the OnClick event of a control via code. I have tried just about everything. How is it done? It's not in any of my developer books or in the help facility that I can find.
The snipet of code:
Set optAnswer = CreateControl("frmOptions", acOptionGroup, , "", "", left, top)
With optAnswer
.ControlSource = i
.DefaultValue = 3
.Name = "option" & i
.Height = 300
.Width = 1700
'Handle nulls passed by the array...
.Tag = IIf(IsNull(arrayrst(5, i - 1)), "", arrayrst(5, i - 1))
.ControlTipText = IIf(IsNull(arrayrst(4, i - 1)), "", arrayrst(4, i - 1))
.OnClick '''''''WHAT GOES HERE?''''''''
End With
The form is programically created and opened up in acDesign mode. All the other properties seem to set fine. Do I have to set the "Contains Module" property first maybe?
Thanks,
Dave