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

    Unanswered: populate field in table

    I have a form that has a field that has a d-look up in it to autopopulate the form. however it is not adding it to table that runs several queries and they are pulled by this particular field. please advise how i can fix the table or the queries to be able to pull by that information

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    How you need to do this depends on the type of information being supplied by the Combobox.

    If the information is coming from a Table and will always be part of the Table, you can, in Form Design View, simply
    1. Right-Click on the Combobox
    2. Click on Properties
    3. Click on the Data Tab
    4. Use the dropdown to select the appropriate Field in the Control Source Property

    If the information will not always be available, you need to
    1. Create a Textbox that is bound to your Field in the Form's underlying Table
    2. Use the AfterUpdate event of the Combobox to assign the selected Value to the Textbox

    An example of the latter would be if you
    • Had a Table that listed current employees
    • You want to use the Combobox to assign a current employee to a project
    • You only want current employees to be displayed in the Combobox
    • You want non-current employees to still be listed in the project records, even after they've left the company

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    Mar 2014
    Posts
    6
    thank you.

    i am not wanting to use a combo box. the field on the form is autopopulated based off their login information by the dlookup. it is in a table that looks and verifies they are a valid employee. I need the table to populate with employee name as well.

  4. #4
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Sorry, I misunderstood! First, you need to follow steps 1-4, above, for the Textbox, instead of the listed Combobox. The use something like this in the OnCurrent event to run the DLookup():
    Code:
    Private Sub Form_Current()
     If Me.NewRecord Then
      Me.EmployeeNameTextbox = DLookup()
     End If
    End Sub

    You'll need to supply the parameters, above, for the DLookup()

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

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