G
Guest
Hello,
I have a form with 230 textboxes wich I use to collect data from a questionnaire.
Now i need to make changes to this form. I don't want to store data from the 230 textboxes but to calculate data from them and store the result.
So i need to delete the controlsource for those textboxes.
To make things easier, I have created on the form a command button with this code
Private Sub Command485_Click()
Dim quale As Integer
Dim nomino As String
For quale = 1 To 270
nomino = "i" & quale
Me.Controls(nomino).ControlSource = ""
Next quale
DoCmd.Close acForm, Me.Name, acSaveYes
End Sub
This way I was suppose to clean the controlsource property for all the controls I intended to clean.
It doesn't work, obviously.
I have tried also:
Private Sub Command485_Click()
Dim ctl As control
For each ctl in me.controls
if ctl.controltype=actextbox then
ctl.ControlSource = ""
end if
Next quale
DoCmd.Close acForm, Me.Name, acSaveYes
End Sub
still not working.
What is wrong?
Thanks...
Rocco
I have a form with 230 textboxes wich I use to collect data from a questionnaire.
Now i need to make changes to this form. I don't want to store data from the 230 textboxes but to calculate data from them and store the result.
So i need to delete the controlsource for those textboxes.
To make things easier, I have created on the form a command button with this code
Private Sub Command485_Click()
Dim quale As Integer
Dim nomino As String
For quale = 1 To 270
nomino = "i" & quale
Me.Controls(nomino).ControlSource = ""
Next quale
DoCmd.Close acForm, Me.Name, acSaveYes
End Sub
This way I was suppose to clean the controlsource property for all the controls I intended to clean.
It doesn't work, obviously.
I have tried also:
Private Sub Command485_Click()
Dim ctl As control
For each ctl in me.controls
if ctl.controltype=actextbox then
ctl.ControlSource = ""
end if
Next quale
DoCmd.Close acForm, Me.Name, acSaveYes
End Sub
still not working.
What is wrong?
Thanks...
Rocco