Hi all. I need your help.
If I have a user form where the users will write wanted values for defined parameters.
How do I get the value from the form to the corresponding parameter?
In the picture: If I write 20 in Parameter 1, the parameter Param 1 should receive the value 20, Param 2 should receive its value and so on when OK is pressed. If I want to change a parameter again I should use the form and write for instance 30 in Parameter 1 and that will result in Param 1 = 30.
What does such code look like?
My form code looks like this:
Private Sub cmdCancel_Click()
Unload Me
Exit Sub
End Sub
Private Sub cmdOk_Click()
Dim lngParameter1 As Long
Dim lngParameter2 As Long
Dim lngParameter3 As Long
If frmParameters.txtParameter1.Value <> "" Then lngParameter1 = frmParameters.txtParameter1.Value
If frmParameters.txtParameter2.Value <> "" Then lngParameter2 = frmParameters.txtParameter2.Value
If frmParameters.txtParameter3.Value <> "" Then lngParameter3 = frmParameters.txtParameter3.Value
Unload Me
Call SetParameters(lngParameter1, lngParameter2, lngParameter3)
End Sub
Thanks in advance
Thomas |