Results 1 to 2 of 2
  1. #1
    mejia.j88 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Nov 2011
    Location
    california
    Posts
    228

    trouble opening switchboards

    hello all,



    I have a database that tracks my wafer inventory; and I'm needing to use it on different computers.

    my problem/question:

    Code:
    I want my database to open a different switchboard depending on the computer that is used. 
    
    
    this is what i have so far:
    
    
    Private Sub Form_Open(Cancel As Integer)
        Call Get_ComputerName
    
        If computername = VMI081 Then
        DoCmd.OpenForm "SwitchBoard-StandardRecovery", acNormal
        Else
        DoCmd.OpenForm "Switchboard", acNormal
        End If
        
    End Sub
    
    
    Private Function Get_ComputerName()
        ' Get Host Name / Get Computer Name
        Get_ComputerName = Environ$("computername")
    
    End Function
    but i can't make it open as the MAIN switchboard, it opens behind the original main switchboard.

    any help would be nice,
    thanks,
    jorge

  2. #2
    pdebaets is offline Competent Performer
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    235
    Try this:

    If computername = VMI081 Then
    DoCmd.OpenForm "SwitchBoard-StandardRecovery", acNormal
    on error resume next
    docmd.close acform. "Switchboard"
    Else
    DoCmd.OpenForm "Switchboard", acNormal
    on error resume next
    docmd.close acform. "SwitchBoard-StandardRecovery"
    End If
    on error goto 0
    Last edited by pdebaets; 01-13-2012 at 04:16 AM. Reason: added error checking

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

Similar Threads

  1. Trouble opening Access file
    By nicknameoscar in forum Access
    Replies: 5
    Last Post: 08-08-2011, 12:32 PM
  2. Switchboards
    By KevinMCB in forum Database Design
    Replies: 2
    Last Post: 02-03-2011, 11:27 AM
  3. Trouble with (R)
    By NOTLguy in forum Access
    Replies: 3
    Last Post: 10-29-2010, 11:55 AM
  4. Iff trouble
    By JackT in forum Access
    Replies: 3
    Last Post: 08-18-2010, 02:28 PM
  5. Replies: 0
    Last Post: 05-18-2007, 02:49 PM

Tags for this Thread

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