Results 1 to 2 of 2
  1. #1
    zeroeu is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    1

    Dlookup Combobox

    Hey I have a form with cascading comboboxes, and I'm using a textbox to display the value, when the combo values dissapear.



    However the textbox displays the numbers that refer to the first column of the bound field and not the text value. Is there a dlookup solution to this?

    The basic architecture is.

    a table Recipe Components

    With each item and categories and subcategories of each item listed.

    I want the textbox on the form to display the text values like the table does.

    The categories and subcategories are each held on 2 other distinict tables.

    Thanks

  2. #2
    Rod is offline Expert
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    Someone should have answered this days ago!

    There can be (and often is) more than one column for a combo box. Without specifying a column, the value of a combo box is its bound value. Check the property window for each of your combo boxes under the Format tab. Look for Column Count. I guarantee the number will be greater than 1. Look also at Column Widths. Each measurement corresponds to a column and I guarantee at least one of the measurements will be zero, effectively hiding the corresponding column when displayed on the form.

    You need to decide which column contains the text value you want. Instead of:

    txtMyText = cboMyCombo1 & " " & cboMyCombo2

    you need something like:

    txtMyText = cboMyCombo1.Column(1) & " " & cboMyCombo2.Column(1)

    Note that columns are numbered relative to zero so Column(1) is the second column.

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

Similar Threads

  1. Replies: 29
    Last Post: 08-16-2011, 05:52 PM
  2. ComboBox "Select" and "DLookUp"
    By witooldas in forum Forms
    Replies: 0
    Last Post: 03-23-2011, 03:31 AM
  3. Replies: 0
    Last Post: 08-24-2010, 06:38 PM
  4. Dlookup??
    By Vikki in forum Access
    Replies: 4
    Last Post: 02-16-2010, 07:59 AM
  5. Replies: 0
    Last Post: 12-16-2009, 01:14 PM

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