Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Sep 2001
    Location
    Detroit, Michigan, USA
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Variables in Access 2K (2000)

    We have a small database into which multiple users will be entering information. I would like to set up 3 variables to capture the name, department, and contact phone number for each person entering information. These values would be inserted into 3 fields in each record that each person enters. This will allow us to track the changes and only require the person entering the information to enter their information once per session. I know this is possible, I am just lost in finding the method. Thanks for any solutions.

  2. #2
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Schenectady, New York, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Variables in Access 2K (2000)

    Dave,

    You could set up a form that requires the person to enter the information when they open the database. Then open your first database form and open the sign in form again as hidden. take the data from the hidden form and add it to your table.

    docmd.OpenForm "form_Name",,,,,acHidden

    one method is to place three hidden fields on your other forms that will update tables and in the before update event place this code similiar to this

    me.fieldName = forms!form_Name!fieldName
    me.fieldPhone = forms!form_Name!fieldPhone
    me.fieldDept = forms!form_Name!fieldDept

    Hope this helps.
    Don
    <img src=/S/flags/USA.gif border=0 alt=USA width=30 height=18> <img src=/S/flags/NewYork.gif border=0 alt=NewYork width=30 height=18> "Life on Earth is expensive, but at least it includes a free trip around the Sun."

  3. #3
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Variables in Access 2K (2000)

    You might also consider activating Access User Security - it simplifies things considerably and you you don't have to store repetitive information.
    Wendell

  4. #4
    New Lounger
    Join Date
    Sep 2001
    Location
    Detroit, Michigan, USA
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Variables in Access 2K (2000)

    Thanks for your suggestions - I'm still plodding along trying to get it to work. Another question arises, how do I clear a one record table through code when the load form "OperatorTable" occurs?

  5. #5
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Schenectady, New York, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Variables in Access 2K (2000)

    Dave.

    Ploace this in the Form-Open Event.

    CurrentDb.Execute "DELETE tbl_name.* FROM tbl_name;"

    This will clear the entire table.

    If you want to remove one row then add a where clause that will select that row.
    Don
    <img src=/S/flags/USA.gif border=0 alt=USA width=30 height=18> <img src=/S/flags/NewYork.gif border=0 alt=NewYork width=30 height=18> "Life on Earth is expensive, but at least it includes a free trip around the Sun."

  6. #6
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Variables in Access 2K (2000)

    It's not clear how you are going to manage with multiple users working simultaneously - unless your database only exists on one machine. In any event, I would create a table of authorized users and make them choose one of those names, which could include the location and phone number so you don't have to store it in every record. Also note that people could enter data directly into tables unless you lock them out. We nearly always use User Security for this kind of thing, and we put a UserID and TimeStamp on each record - the list of users in maintained in the Security workgroup file, and the userID is always available with the CurrentUser() function. Your approach will work, but requires a fair bit of effort to make it work well, and you are reinventing part of the wheel, so to speak.
    Wendell

Posting Permissions

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