Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text box on a form to a variable in a module

Status
Not open for further replies.

revz

Technical User
Apr 18, 2001
10
0
0
GB
Heya,

I have a look through the Q&As of previous posts and since I am only a beginner with VBA, not much of it made much sense.

The problem I have is that I want a module to look at a text box on a form (to see what the value is) and depending on the value of the number inside the text box, do a certain calculation.

Now I have wrote the Select... Case statements using VB knowledge to work out the number boundries and it works, but the only problem is I don't know how to get the number inside the textbox to be set as a variable within my module.

Can anyone help?

Tom Griffiths
tom@vscan.org
 
Sure Tom,
In your procedure...

Dim intSomething as Integer

intSomething = Forms![NameofYourForm]![NameOfYourTextBox]

Select Case intSomething
Case 1
'Do this
Case 25
'Do another thing
Case else
'Do something when all else fails?!
End select
Hope that's what you're after... :) Gord
ghubbell@total.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top