Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2014
    Posts
    6

    Unanswered: ID verification and auto populate

    I have a form that is being used and i want the name (ID) and employee ID number to auto populate based off their sign in. Currently I have it as a Select expression (see below) and when they click on the form it ask for their ID repeatly.

    here it is

    SELECT [User Activity User].UserName FROM [User Activity User] ORDER BY [UserName];

    Please let m know what I need it to do that once they sign on it will automatically populate their information based on their ID they log in with.

    Much appreciated with any help.

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You don't supply enough information. How is the form built? Is it bound or unbound? What is the structure of the table(s) involved? What code is actually in use? What you posted is a query (= SQL), how is it used?
    Have a nice day!

  3. #3
    Join Date
    Mar 2014
    Posts
    6

    ID verification

    Form was created by a table that was created by an excel spreadsheet. however it is not bound to anything

    this is the code for the form. What i sent you was being used in another db that is somewhat simular to the one I am creating. which is working somewhat however I dont want them having to sign in 4 times. I want it to where when they sign on with their Employee ID from the beginning log in screen; it will auto populate the form from there once I get it to working correctly. (another matter all together) Please let me know if this make since.


    Private Sub Submit_Click()
    On Error GoTo Err_Submit_Click


    DoCmd.GoToRecord , , acNext

    Exit_Submit_Click:
    Exit Sub

    Err_Submit_Click:
    MsgBox Err.Description
    Resume Exit_Submit_Click

    End Sub
    Private Sub save_Click()
    On Error GoTo Err_save_Click


    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

    Exit_save_Click:
    Exit Sub

    Err_save_Click:
    MsgBox Err.Description
    Resume Exit_save_Click

    End Sub

    Private Sub Date_BeforeUpdate(Cancel As Integer)

    End Sub

    Private Sub Name_BeforeUpdate(Cancel As Integer)

    End Sub

    Private Sub Next_Click()
    On Error GoTo Err_Next_Click

    DoCmd.GoToRecord , , acNext

    Exit_Next_Click:
    Exit Sub

    Err_Next_Click:
    MsgBox Err.Description
    Resume Exit_Next_Click

    End Sub

  4. #4
    Join Date
    Mar 2014
    Posts
    6

    ID Verificatin and auto populate

    The forms was created from a table and is not bound. Below is the current code that i have. I will be perfectly honest I am not a code writer so any help on getting this correct is greatly appreciated. I would like it to when they sign in to the data base it will auto populate the two fields of Employee name and ID based off their login.

    The query i gave below was taken from another data base currently being used with similar attributes.

    Current Code:
    Option Compare Database

    Private Sub Submit_Click()
    On Error GoTo Err_Submit_Click


    DoCmd.GoToRecord , , acNext

    Exit_Submit_Click:
    Exit Sub

    Err_Submit_Click:
    MsgBox Err.Description
    Resume Exit_Submit_Click

    End Sub
    Private Sub save_Click()
    On Error GoTo Err_save_Click


    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

    Exit_save_Click:
    Exit Sub

    Err_save_Click:
    MsgBox Err.Description
    Resume Exit_save_Click

    End Sub

    Private Sub Date_BeforeUpdate(Cancel As Integer)

    End Sub

    Private Sub Name_BeforeUpdate(Cancel As Integer)

    End Sub

    Private Sub Next_Click()
    On Error GoTo Err_Next_Click


    DoCmd.GoToRecord , , acNext

    Exit_Next_Click:
    Exit Sub

    Err_Next_Click:
    MsgBox Err.Description
    Resume Exit_Next_Click

    End Sub

  5. #5
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Quote Originally Posted by Chekotah View Post
    Form was created by a table that was created by an excel spreadsheet. however it is not bound to anything
    I don't understand how you can have a line such as:
    Code:
    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
    If the form is not bound.
    Have a nice day!

Posting Permissions

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