Results 1 to 3 of 3
  1. #1
    Jman is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    1

    Post Comboboxes blank when form recordset has no records


    I have a series of three comboboxes on a form that let the user narrow down their record selection criteria on a table of invoices: 1) cboClientID, 2) cboProjectID, 3) cboVendorName, in that order. In the AfterUpdate sub for cboClientID, I set the other two comboboxes to display null and then set the form's recordsource to "SELECT * FROM tblInvoices WHERE ClientID=0" in order to display no records until a ProjectID has been entered. This works just fine in Access 2003, but in Access 2007 it blanks out the values selected in the comboboxes so that they appear to be empty when in fact they are not. This is rather disconcerting to the users, to say the least.

    Is there a better way to do what I'm trying to do or is there a way to work around this in 2007?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    Interesting, I would have expected the same behavior for 2003.

    I presume the comboboxes are multi-column with a lookup alias. This means when the combobox is filtered, lookup values are not available for display.

    Is the form in continuous or datasheet view and multiple records are visible at a time? I have dealt with numerous threads on this same issue and have yet to discover a satisfactory solution for situation where multiple records are viewed.

    Might have to use an unbound combobox and code to populate it with the field value and code to save selected value.
    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
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    That suggests the combo boxes are bound to table/query fields. What you might try is to have all the combo boxes unbound, and set the form record source only when you make a selection from cboProjectID. The other thing you might try is to change the form's filters according to your selections, instead of changing the recordsource.

    John

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

Similar Threads

  1. open form based on comboboxes
    By bigmac in forum Forms
    Replies: 1
    Last Post: 04-04-2012, 06:55 AM
  2. Replies: 2
    Last Post: 03-08-2012, 12:59 PM
  3. Recordset returning blank value
    By Mohamed in forum Access
    Replies: 1
    Last Post: 10-24-2011, 09:31 AM
  4. Replies: 4
    Last Post: 12-13-2010, 05:33 PM
  5. Cascaded comboboxes in a form
    By luca in forum Forms
    Replies: 2
    Last Post: 11-22-2009, 05:36 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