Set form fields as variables

  • Thread starter Thread starter Maciej Paras
  • Start date Start date
M

Maciej Paras

Hello!
Can anybody answer this (maybe childish) question?
I've created a form named FORM1. This form contains 3 texboxes named F1, F2
and F3.
Now I want to append a button, that sould handle the data from the form and
then calculate other values.

This is the code:
Private Sub Command7_Click()

Dim Var1 As Double
Dim Var2 As Double
Dim Var3 As Double

***** And the problem is, that when I attempt to connect these variables
with fields from form, using statement:
Var1 = FORM1.F1
**** it tells me that there was "An object expected"


Please, tell me what is the correct statement for connecting data from a
form with VBA variables?

Thank you!
Kind regards from Poland, Maciej Paras
 
Var1 = Me.F1
...

Suggest you read a book on Access VBA for basic knowledge on how to write
VBA code and reference Forms / Controls in VBA code.
 
Back
Top