Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2013
    Posts
    25

    Question Unanswered: I need to make a db for 5 different computers, each only able to view its own form!

    Hello. Im a mechanical engineering intern with only tangential knowledge of databases and i've been tasked with a scrap reporting database. Im not a stranger to access but I definitely have no idea how to make it!
    I need each assembly channel to only be able to input data specific from that channel (the fields for each channel are not universal but not exclusive either) and nothing else.
    My intuition tells me that the more elegant way would involve programming knowledge well beyond my education (and payroll haha) in networks but maybe there's a way to put specific access files with only forms and tables specific to what i want each user to be able to manipulate, then automatically synch it with a "parent" locked access file? Is that possible? how can i do it?
    Thank you very much in advance!
    BTW im working with access 2003 if that makes a difference

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Usually, a database is more often personalized according to the current user than to the current computer. Here's a solution that can be used in both cases:
    1. Create a Macro, name it Autoexec and have it run the Function StartUp().
    2. In a standard module, create the function StartUp:
    Code:
    Public Function StartUp()
    
        Dim strForm As String
    
        Select Case Environ("ComputerName")
            Case "Computer1":    strForm = "Frm_Computer1"
            Case "Computer2":    strForm = "Frm_Computer2"
            Case ...
        End Select
        If Len(strForm ) > 0 Then
            Docms.OpenForm strForm, options...
        Else
            MsgBox "You're not allowed to open this application", vbExclamation, "Closing"
            Application.Quit
        End If
    End Function
    Change Computer1, Computer2, Frm_Computer1, etc. to the appropriate values.

    3. If you want to use the user name instead of the computer name, use:
    Code:
        Select Case Environ("UserName")
    and adapt the values accordingly.
    Have a nice day!

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Id be tempted to use a variant on Sinndho's approach..
    have a single db (well truth to be told I'd have two db's
    one for the data (the back end on a central server)
    one for the user interface (the front end), but deployed as individual copies on each users workstations

    although truth to be told I'd probably want to limit the selection based on a user logon as opposed to a computer name... why its more problem tolerant. if a computer gets replaced you have to modify the code

    y'd probably want to have the ability to see any 'channel' so allow certian user grousp to specify what channel they shoudl see/use

    im guessing the design would be sort of simialr to the sub/supertype model
    with a tabel for channel data (all common data)
    a table for each channel containing non common data

    another good reason to consider a single db is progrma maintenance and development. yes its going to cost a lit bit more in time to develop, but you only ever have to make changes to one front end. there i sno risk of fornt ends being out of step
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    Sep 2013
    Posts
    25
    Quote Originally Posted by Sinndho View Post
    Usually, a database is more often personalized according to the current user than to the current computer. Here's a solution that can be used in both cases:
    1. Create a Macro, name it Autoexec and have it run the Function StartUp().
    2. In a standard module, create the function StartUp:
    Code:
    Public Function StartUp()
    
        Dim strForm As String
    
        Select Case Environ("ComputerName")
            Case "Computer1":    strForm = "Frm_Computer1"
            Case "Computer2":    strForm = "Frm_Computer2"
            Case ...
        End Select
        If Len(strForm ) > 0 Then
            Docms.OpenForm strForm, options...
        Else
            MsgBox "You're not allowed to open this application", vbExclamation, "Closing"
            Application.Quit
        End If
    End Function
    Change Computer1, Computer2, Frm_Computer1, etc. to the appropriate values.

    3. If you want to use the user name instead of the computer name, use:
    Code:
        Select Case Environ("UserName")
    and adapt the values accordingly.
    Thank you very much! but im afraid i don't know coding (not yet at least) Can you walk me through it? can you make an example with 2 forms: Scrap1 for user1 and Scrap2 for user 2? and while i appreciate the extra tip about the error message, right now it means a new layer of complexity which i want to skip until i have a running prototype!

  5. #5
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    If you expect the form named Scrap1 to open when the user that opened the Windows session is User1 and the Form named Scrap2 to open when the user that opened the Windows session is User2 use:
    Code:
    Public Function StartUp()
    
        Dim strForm As String
    
        Select Case Environ("UserName")
            Case "User1":    strForm = "Scrap1"
            Case "User2":    strForm = "Scrap2"
        End Select
        If Len(strForm ) > 0 Then
            Docms.OpenForm strForm ' You can add options when you open a form. See DoCmd.OpenForm in Access help.
        Else
            MsgBox "You're not allowed to open this application", vbExclamation, "Closing"
            Application.Quit
        End If
    End Function
    Have a nice day!

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
  •