From VBA to Text Box

gpeirce

Registered User.
Local time
Today, 14:43
Joined
Sep 24, 2015
Messages
22
I posted before but things got too confusing. I have some variables coded in a VBA module. The results are in fields called intA, intB and intC.

I also have 3 texts boxes in a form. How do I code the text boxes so I can display intA, intB and intC? Do I put something in the control source? Do I name the box in a certain way? Do I put some code in like me.intA.value = something or other??

An accdb example would be nice too, if you have it.

Thank you.
 
You do it in code:
For intA a sample below.
Code:
Me.YourTextCotrolName = intA
 
I think you are confusing the terms.
Fields are only in tables.

Make these variables as Public variables.
Risk is they might change somewhere on the way to your text box.

In your form's OnOpen event you can put:
MyForm.MyTextBox = intA

If these variables are a result of a function you better use:
MyForm.MyTextBox = fnMyintAFunction()

or simply put = fnMyintAFunction() as the rowsource for your textBox
 

Users who are viewing this thread

Back
Top Bottom