Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Nov 2008
    Location
    Melbourne, Australia
    Posts
    69
    Thanks
    8
    Thanked 1 Time in 1 Post

    Help needed with VB

    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

    Code:
    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

  • #2
    Banned
    Join Date
    Jun 2007
    Location
    Web Designer
    Posts
    321
    Thanks
    0
    Thanked 6 Times in 6 Posts
    Should not the menu be inside a form ?

  • #3
    New Coder
    Join Date
    Aug 2008
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •