Results 1 to 11 of 11
  1. #1
    jlyalls is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2016
    Posts
    19

    How do you open multiple forms after onclick

    I have designed a login screen and after you successfully log in I would like to open multiple forms at the same time. At the moment I can successfully open 1 at a time. Here is my code.




    Option Compare Database


    Private Sub Command1_Click()
    If IsNull(Me.txtLoginID) Then
    MsgBox "Please Enter LoginID", vbInformation, "LoginID Required"


    Me.txtLoginID.SetFocus
    ElseIf IsNull(Me.txtPassword) Then
    MsgBox "Please Enter Password", vbInformation, "Password Required"
    Me.txtPassword.SetFocus
    Else
    'process the job
    If (IsNull(DLookup("[UserLogin]", "tblUser", "[Userlogin] ='" & Me.txtLoginID.Value & "' And password = '" & Me.txtPassword.Value & "'"))) Then
    MsgBox "Incorrect LoginID or Password"
    Else
    DoCmd.Close
    'MsgBox "LoginID and Password correct"
    DoCmd.OpenForm "P1 Vlan Database Form" *//THIS IS WHERE I WANT TO MAKE IT OPEN MORE THAN ONE FORM//*

    End If
    End If
    End Sub




    So if you guys know a way I can add a doCmd.OpenForm to open the other forms I would really appreciate it!

    Thank you,

    Josh

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    FYI, the top two lines of EVERY module should be
    Code:
    Option Compare Database
    Option Explicit

    To open more forms, repeat the command. Try:
    Code:
    DoCmd.OpenForm "P1 Vlan Database Form", acNormal
    DoCmd.OpenForm "Form2", acNormal
    DoCmd.OpenForm "WorkHours", acNormal
    DoCmd.OpenForm "EmployeeNames", acNormal
    Be advised: You should NOT have spaces in object names.
    See http://access.mvps.org/access/tencommandments.htm Commandment #3

  3. #3
    jlyalls is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2016
    Posts
    19
    Ok thank you very very much!!! You guys on here are great! That worked! Do you think it would make more sense to Create a login and then have a form with tabs that include each individual form inside its own tab? I am trying to make it easy and accessible to edit each database quickly. The company I work for has been using approach for years and it has been a pain opening up each record.

    Thank you!

    Josh

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    We know nothing about your business, so can't really give a good answer. Describe you business, not how you want to do things in Access. Pretend like we are in line at Burger King and you are explaining what your company does.

    I am trying to make it easy and accessible to edit each database quickly
    Do you mean table/record instead of database?

  5. #5
    jlyalls is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2016
    Posts
    19
    Ok we are a telecommunications company and we have to build "Services" through our networks. We have this split up into 4 Networks that are located in different locations within our serving area.

    The P1 Vlan Database

    The P2 Vlan Database

    The P3 Vlan Database

    The BTI Vlan Database

    Each of these Vlan databases have 1-4096 available Vlans that can be used.

    When we build a circuit for a customer we have to pick out a Vlan in that network, and if that customers traffic on the circuit has to cross all the areas then we have to fill in the information in each vlan database.

    ie: Customer X has a circuit that needs to be built from location A to location B, and it will enter into all of our P Vlans and our BTI Vlans. We then will go into each database and enter in the customers information and some circuit information.

    I hope that makes some sense. Most cases a service circuit is either a T1, PRI, ect.

    Thanks,

    Josh

  6. #6
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Still not tracking...... do you have 4 files named something like P1_Vlan.accdb, P2_Vlan.accdb, P3_Vlan.accdb and BTI_Vlan.accdb.
    Or is there one accdb file that has 4 tables?

  7. #7
    jlyalls is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2016
    Posts
    19
    Sorry, I think its all in one database. Here is a snap shot.

    Click image for larger version. 

Name:	AccessSnapshot.PNG 
Views:	17 
Size:	46.5 KB 
ID:	24451

  8. #8
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    OK, so you have 4 tables, not databases.
    I would rename them to something like: "P1_Vlan_table", "P2_Vlan_table" or "tblP3_Vlan", "tblBTI_Vlan". (and remove the spaces)

    I can't tell what the relationships between the tables are. It kind of seems like this dB was created from a spreadsheet.

    Do you think it would make more sense to Create a login and then have a form with tabs that include each individual form inside its own tab? I am trying to make it easy and accessible to edit each database quickly. The company I work for has been using approach for years and it has been a pain opening up each record.
    You could try using a form with a tab control on it for the sub forms. The (sub) forms are already created.


    I'm still bothered by the table structures/design/relationships.

  9. #9
    jlyalls is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2016
    Posts
    19
    Yeah I imported this from an exported excel file that came from Lotus approach. I did not want to have to go in and manually enter all the information since there are 4096 records in each table.

    As far as the relationships go I have not set up any. I still do not understand the relationship aspect of access.

    Thanks,

    Josh

  10. #10
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Customer X has a circuit that needs to be built from location A to location B, and it will enter into all of our P Vlans and our BTI Vlans. We then will go into each database (table) and enter in the customers information and some circuit information.
    So if you acquire "Customer Z", do you then have to add another 4096 records to each of the 4 tables?

    Each customer has 4096 records pre-entered in each of 4 tables?

    Does "tblUser" hold the customer info?

  11. #11
    jlyalls is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2016
    Posts
    19
    No, if we acquire a customer, then they will have either a Point to Point connection with A being the Start and Z being the finish (A------------------------Z) in between the A and Z is fiber optic lines that go through a "Ring" Each ring is a set of Nodes with in an area. So lets say a customer needs an internet circuit to another location (Z) Well we then have to build the circuit through our nodes, through the fiber. So if customer A is staying with in the P1 Ring, then it would take up one vlan # which could be any number between 1 through 4096. A vlan is a Virtual Local Area Network, and it basically throws a tag on an IP packet saying "hey I am in VLAN X" and the interface it goes to has to be programmed to accept that VLAN number. Otherwise it drops the packet if it does not have a VLAN Number. (Got a little off topic but kind of wanted you to understand VLANS) So if the fiber ends up going through multiple areas, say it goes to P1 and has to cross to P2, then we have to make sure that we pick a Vlan number that is vacant in both P1 and P2 tables (which are the rings as well as P3, and BTI)

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 10-23-2013, 08:11 AM
  2. Replies: 2
    Last Post: 08-07-2013, 07:44 AM
  3. Replies: 6
    Last Post: 10-11-2012, 02:19 PM
  4. OnClick open
    By Molly152 in forum Forms
    Replies: 5
    Last Post: 11-18-2010, 10:32 AM
  5. Open Multiple forms in runtime access
    By Tifa in forum Access
    Replies: 4
    Last Post: 08-20-2010, 06:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums