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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Case Function not working on My Form!!!!

Status
Not open for further replies.

Kckronic21

Programmer
Jul 29, 2001
81
US
I have the folling code in my Form:

Private Sub Message_Coomand_Button Click()
Dim Agetxtbox
Select Case Agetxtbox
Case 18
Messagetxtbox = "You are old enough to vote"
Case 21
Messagetxtbox = "You are old enough to drink"
Case 65
Messagetxtbox = "You are old enough to retire"
End Select
End Sub

This code will not work. Can someone please tell me what I am doing wrong? Thanks!
 
Hi!

Get rid of your Dim statement.

hth
Jeff Bridgham
bridgham@purdue.edu
 
Not trying to be rude but just to check on my own lack of knowledge
would an extra m one less o and an Underscore in
Private Sub Message_Command_Button_Click()
help too.

Or would someone help me out by telling me if it matters.
Just checking
Jim
~;-)~
 
Hi Jim!

You're absolutely correct, that would make a difference. I had assumed that it was just a typo, but I shouldn't have. Thanks for bringing it up!

Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top