Results 1 to 6 of 6

Thread: How to Open only one form at time in Access ??

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2005
    Posts
    152

    Exclamation How to Open only one form at time in Access ??

    hi all,

    i have multiple form in access i am using access as a database and design form in access only so i have one main form which contain number of button (like a menu option's) from there i open one other form which also contain number of button for opening of the form i want to open one form at a time as follows ( following is no of button which open one form )

    1) form main
    Customer--
    Other info--
    Exit--
    2) form Customer
    Edit/Del Customer
    Edit/ADD Customer
    Return to Main form
    3) from Other info
    My Company info
    Return to Main form
    4) Exit button

    when i am opening form main and click on "Customer button" it open form Customer and it remain form main also open is it posible that it open "form customer" in same windows ?? also when i am opening the Database at that time my "form main" should be open is it posible ?? how ??
    pls help me regarding this ??

    thanx in advance..
    Nilesh Thakur.

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

    Re: How to Open only one form at time in Access ??

    You can write the macro code to open and close the previous form. Then call it from the button click.
    VB Code:
    1. 'Behind Main form:
    2. Option Compare Database
    3.  
    4. Private Sub cmdCustome_Click()
    5.     DoCmd.OpenForm "Customer", acNormal, "", "", , acNormal 'Show desired form
    6.     DoCmd.Close acForm, "Menu" 'Close Main form
    7. End Function
    8.  
    9. 'Behind Customer Form:
    10. Option Compare Database
    11.  
    12. Private Sub cmdBackNav_Click()
    13.     DoCmd.Close acForm, Me.Name 'Close current form
    14.     DoCmd.OpenForm "Main", acNormal 'Return to Main form
    15. End Sub
    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

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2005
    Posts
    152

    Re: How to Open only one form at time in Access ??

    hi RobDog,
    thanx again for giving answer for my question as you tell me i need to write one micro first i had try to write the micro but it show me one window with name Action i select the Runcode action so i can try the code over there and run my code from there but not able to do this ... pls tell me how to do this or directly write the code on button click event ???.....pls help me regarding this ..
    and also tell me how to open my main page when database is open first time ...
    thanx in advance
    Nilesh Thakur.

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

    Re: How to Open only one form at time in Access ??

    Tools > Database Utilities > Switchboard Manager... This is where you can specify a startup form for when the db is opened.

    If you open your main form in design view and click on the cliss button you will be able to view the clode for the form. This is where you will place similar code to what I had posted.
    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

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Nov 2005
    Posts
    152

    Re: How to Open only one form at time in Access ??

    hay robDog,
    is there any other way to set Default start page ??
    because when i use Tools > Database Utilities > Switchboard Manager...
    then it create one form Swithchboard and arrange all sequence of the form it's own ..
    pls help me regarding this ...
    if this one is only single way to craete it then can you pls tell me in detail way how to create Switchboard page or mane page...
    thanx in advance..
    Nilesh Thakur.

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

    Re: How to Open only one form at time in Access ??

    Sorry, I meant Tools > Startup...

    Its was very late last night
    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

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