Results 1 to 3 of 3
  1. #1
    irish_wertzy is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    2

    Populating a text box with data from a lookup from a SQL table based on a combobox selection

    Hey there!



    I have a very simple (right now) User Form. The top portion has the User select a part number in a combobox (called cmbPartNum.

    The next section contains Basic Part Data (that is stored in a table). I have several text boxes in this section that I want to create lookups for. The lookup should take the part number, and look up a field in the table (Base Number) and return it to the text box (txtBase8).

    I tried this code in the Control Source of my Text Box (txtBase8): =DLookUp([dbo_tblDM2Import]![Base Number],[dbo_tblDM2Import],[dbo_tblDM2Import]![Part Number]=cmbPartNum.value

    I get #Name? as the result, no matter what Part Number I choose.
    Click image for larger version. 

Name:	access form.jpg 
Views:	12 
Size:	41.1 KB 
ID:	32675

    Thanks in advance!

  2. #2
    irish_wertzy is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    2
    I actually solved it on my own.....more complicated due to the SQL table source:
    =DLookUp("[dbo_tblDM2Import]![Base Number]","[dbo_tblDM2Import]","[dbo_tblDM2Import]![Part Number]= '" & [cmbPartNum] & "'")

  3. #3
    sandeepG is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Feb 2018
    Location
    Bangalore
    Posts
    1
    It is more complicated.

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

Similar Threads

  1. Replies: 2
    Last Post: 02-16-2015, 08:27 AM
  2. Replies: 1
    Last Post: 11-15-2013, 11:42 PM
  3. Replies: 9
    Last Post: 01-17-2013, 09:08 PM
  4. Populate a text box based on a combobox selection?
    By Richie27 in forum Programming
    Replies: 4
    Last Post: 04-25-2012, 08:00 AM
  5. Replies: 4
    Last Post: 02-09-2012, 03:03 AM

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
  •  
Other Forums: Microsoft Office Forums