...

View Full Version : Help needed with VB



kryssy23
05-24-2009, 05:05 PM
Hey guys,
I am using VB via microsoft access 07. I am trying to make a menu but i cant seem to get it to work properly. the menu needs to look something like this...


Lessons
---------------------
1. cat
2. jet
3. wind

Hire
---------------------
4. cat
5. jet
6. wind

Reports
--------------------
7. daily report

8.quit

thats hopefully the end result... i keep getting errors when trying to make the menu... here is what i have so far



Sub main()

Dim choice As Long
Dim menuChoice As Long
Dim exitChoice As Long
Dim choice1 As Long
Dim choice2 As Long
Dim choice3 As Long
Dim menu As String

choice = ""
While menuChoice <> exitChoice
Debug.Print menu;
choice = InputBox("1. lessons 2.hire 3. report")
If menuChoice = choice1 Then
lesson 'lesson is the name of another sub
Else
If menuChoice = choice2 Then
hire 'hire is the name of another sub
Else
If menuChoice = choice3 Then
report 'report is the name of another sub
End If
End If
End If
Wend

End Sub

any help would be great:thumbsup:

it career
05-25-2009, 08:40 AM
Should not the menu be inside a form ?

jhouns
06-16-2009, 11:42 PM
Should not the menu be inside a form ?

Not neccesarily as long as it runs to the specified output it could be a module of some sort, butt he easyest way to do it would be through a form you're right.

What kind of errors do you get, can you post them?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum