Results 1 to 4 of 4
  1. #1
    bigguy is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    11

    Help with combo box on form

    I would really appreciate some help with a problem that I'm having.

    I have a search form that has a combo box which a user selects a name from and that opens a results form with the data from that client.
    Everthing works fine except that whatever name you choose from the combo box always opens the first record and not the selected one. My code for combo box On Change is

    DoCmd.OpenForm "ResultsFrm", _
    WhereCondition = "RecipientsName = " & Nz(Me.RecipientsName, 0), _


    WindowMode:=acDialog

  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
    Are you filtering on text name value or on number ID value?

    Show the combobox properties:
    RowSource
    BoundColumn
    ColumnCount
    ColumnWidths

    Use AfterUpdate instead of Change event.
    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
    bigguy is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    11
    Quote Originally Posted by June7 View Post
    Are you filtering on text name value or on number ID value?

    Show the combobox properties:
    RowSource
    BoundColumn
    ColumnCount
    ColumnWidths

    Use AfterUpdate instead of Change event.
    I'm using text name. My combobox value's are

    Row source = MainTbl
    Bound Column = 1
    Column Count = 1
    Columnwidths = Empty

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    The RowSource is reference to a table. This will pull the first field. Is the first field an autonumber ID?

    Better to have the RowSource explicitly select field(s) with an SQL statement.

    Why use name as criteria? What if there is more than one Jane Smith? Use unique identifier such as CustomerID to filter records.
    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: 1
    Last Post: 10-30-2012, 10:29 AM
  2. Replies: 5
    Last Post: 03-12-2012, 02:58 AM
  3. Replies: 2
    Last Post: 07-26-2011, 08:26 AM
  4. Replies: 5
    Last Post: 01-02-2011, 10:09 AM
  5. Replies: 0
    Last Post: 08-17-2008, 12:19 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