Results 1 to 15 of 15
  1. #1
    WhatnThe is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Dec 2009
    Posts
    50

    Dlookup Lookup Value

    I have two tables & a data entry form in my access database so far.

    Table: DataTracking
    Table: LookUpValues
    Form: DataEntry

    My form looks like this

    ID
    Part Number
    Date
    Employee
    Pieces
    Default Speed
    Actual Speed

    The data entered in this form is added to the DataTracking table. I would like to have the “Default Speed” be automatically populated when I enter a part number. Is this possible to do this with a dlookup?
    Last edited by WhatnThe; 12-30-2009 at 04:49 PM. Reason: Spelling

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Probably. What is the relationship between Default Speed and Part Number? Is the value in the "LookUpValues" table? If so then why not just use a ComboBox to select the PartNumber from that table and a Join in the RecordSource of the form to fill in the DefaultSpeed. Or maybe the AfterUpdate event of the ComboBox.

  3. #3
    WhatnThe is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Dec 2009
    Posts
    50
    Basically what I have here is a part tracking data base. The form that I have created is intended to add information to the Table: DataTracking. The look up values have every part that we run, and specific information to each part. The default speed data is located in the Table: LookUpValues. What I want to do is when a user types a part number in the form; I would like to have the default speed be automatically populated within the form.

    These type of automatic look up values will be utilized within different forms. It is meant to be a convenience for the users adding data to the part tracking data base. I have been looking for a way to populate certain fields and have been unable to find a solution. I am fairly new to access.

    If you would like an example of what I am looking for I can upload a sample of the database I am working on with dummy data.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Since you will need to validate the PartNumber anyway, do you have a problem using a ComboBox so the user can select a valid number?

  5. #5
    WhatnThe is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Dec 2009
    Posts
    50
    Nope, I would not mind a combo box for the part number, but I am not sure how to go about doing this.

    This is how my form would look then?:

    ID
    Part Number - Combo Box from LookUpValue Table
    Date
    Employee
    Pieces
    Default Speed - To be populated from Combo Box
    Actual Speed

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Yes. Go ahead and post your sample db and I'll get you started.

  7. #7
    WhatnThe is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Dec 2009
    Posts
    50
    Ok, I have a dummy version of what I am working with attached. On the form I have labeled it with some text information. Feel free to add to or remove anything you need to, but please let me know what you did so I can learn the howto's Thanks in advanced for your assistance.

    I did try to create the combo box but, I could not get it to auto populate the required speed & I could not get the part number to add to the data entry table from the combo box
    Last edited by WhatnThe; 12-31-2009 at 12:58 AM.

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Here's how to do it with a join query as the RecordSource of the form.

  9. #9
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    And here it is just using the AfterUpdate event of the ComboBox.

  10. #10
    WhatnThe is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Dec 2009
    Posts
    50
    Thanks for fixing the form, its doing what I wanted to do now but, I am still having the issue where the data recorded in not being added to the data entry table. I mean it is but its adding the LookUpId instead of the part.

    Also if it not to much trouble would you explain how you did it?

  11. #11
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You probably want to look at the 2nd sample. The first one is all done with the query.

  12. #12
    WhatnThe is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Dec 2009
    Posts
    50
    Thanks a million for your second example. I have figured out how you did it! Your the man! The second example was much easier to figure out. Although if you could point me to an area to learn the first example I would be grateful.

  13. #13
    WhatnThe is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Dec 2009
    Posts
    50
    One last question about your sample three. If I wanted to have another populated cell using the code would I add the Me.SpecSPM = Me.PartNumber.Column(2)
    or would I need to create a new code.

    Lets say I want also display the output as well as the default speed. Would the code look like Me.Output = Me.SpecSPM = Me.PartNumber.Column(2) or would I need to create a new code?

  14. #14
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I believe the Output is the 4th column of the RowSource so the code would be:
    Me.Output = Me.PartNumber.Column(3)

  15. #15
    WhatnThe is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Dec 2009
    Posts
    50
    Nevermind I figured it out. I was not placing the code in the correct position. I do thank you for your help. I am going to mark this issue as solved.

    I will start new threads as I am sure to have a few more question in the next few days.

    Thanks again!!!

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

Similar Threads

  1. Auto-Populate Combo box
    By vincenoir in forum Forms
    Replies: 3
    Last Post: 10-14-2009, 07:06 AM
  2. Replies: 3
    Last Post: 10-05-2009, 07:22 AM
  3. Auto Populate Data from Main Form
    By billiejean in forum Forms
    Replies: 0
    Last Post: 08-05-2009, 08:08 AM
  4. auto populate and table relationships
    By jmarti57 in forum Access
    Replies: 0
    Last Post: 11-09-2008, 09:50 PM
  5. Auto populate fields on a form
    By ldarley in forum Forms
    Replies: 0
    Last Post: 08-14-2008, 09:39 AM

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