Results 1 to 5 of 5

Thread: visual basic-navagating through forms

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2009
    Posts
    10

    visual basic-navagating through forms

    i have to do a dialog for a company and it contains many forms and link between the forms. for example if i want a button in the menu to navagate the user to form 2 where they can proceed further. what is the code to use? simple navagtion code to take the user to wriet forms.

    ill be waiting for ur response, many thanks

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: visual basic-navagating through forms

    Moved from the CodeBank

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: visual basic-navagating through forms

    In your click event of either a menu item or button just show your new form and either hide or unload your first form.

    Code:
    Form2.Show
    Form1.Visible = True
    'Or
    'Unload Form2
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4

    Thread Starter
    New Member
    Join Date
    Jan 2009
    Posts
    10

    Re: visual basic-navagating through forms

    hi, i am struggling with a simple login form. i have already created the rest of the forms and now want to have a login form as my first form. i have tried the following code but nothin is comming up. please help !!

    If txtusername.Text = "20620752" Then

    End If
    If txtpassword.Text = "lizan" Then

    End If
    'Accepted, continue to frmmainmenu.Show, Else Msg("Wrong Password") End IF Else Msg("Wrong Username")End IF

  5. #5
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: visual basic-navagating through forms

    Is this what you want?

    Code:
    If txtusername.Text = "20620752" Then
        If txtpassword.Text = "lizan" Then
            frmmainmenu.Show
        Else
            Msgbox "Wrong Password"
        End If
    Else
        Msgbox "Wrong Username"
    End If

Posting Permissions

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



Click Here to Expand Forum to Full Width