Results 1 to 4 of 4
  1. #1
    EddieN1 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    316

    Combo Box - Select Field versus Populating Field


    I have a combo box where the Bound field is CustNbr. When the dropdown is selected, I want to list a LookupName, and DisplayName with CustNbr in the first column (with a width of zero so it doesn't show). If the operator starts entering letters, I want the list to automatically change position based on entered letters in LookupName column. However, after the selection is made, I want the DisplayName to appear in the combo box. Any Suggestions?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Don't think that is possible. Have a textbox show the DisplayName with an expression that references the combobox column index. Index begins with 0.

    =[comboboxname].[Column](2)
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    EddieN1 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    316
    I figured out a way to do this. Set up Column Widths to 0";0";2" as a default. On Enter, change it to 0";2";2". On Exit, change it back to 0";0";2". However, since I can't say... Me.CustName.ColumnWidths = "0";2";2"" (the compiler throws up with all the quote marks), I dimmed a string named, say, strWid and set it to...
    "0" & Chr(34) & ";2" & Chr(34) & ";2" & Chr(34)
    and then said... Me.CustName.ColumnWidths = strWid. The Chr(34) are double quotes.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    I should have said 'not possible without VBA code'. Glad you found a solution.

    "0"";2"";2""" might work

    Also, not including the " might work because when in Design view, Access will provide the inch symbol (") if forgotten, although might not in runtime.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 4
    Last Post: 07-28-2013, 12:40 AM
  2. Replies: 2
    Last Post: 08-16-2012, 10:02 PM
  3. Populating a field
    By manicminer in forum Forms
    Replies: 7
    Last Post: 06-20-2012, 10:53 AM
  4. Replies: 3
    Last Post: 07-14-2011, 05:33 PM
  5. populating value of one field to another
    By jzacharias in forum Database Design
    Replies: 2
    Last Post: 09-08-2010, 02:39 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