Results 1 to 3 of 3
  1. #1
    sdondeti is offline Novice
    Windows 98/ME Access 2003
    Join Date
    Aug 2009
    Posts
    23

    How to select ComboBox list in Run time

    Hi,



    In Run time Combo Box list is filled with sql as below:

    Select State, acctID, BranchID, BranchName, DivisionID,
    Inactive
    , sqlBranchID from vqryBranch

    User can select combobox one of the populated list from the above query.

    I got a requirement to programatically select one of the list in combo box.

    I did program as :
    Forms![frminitialclaims]![Branch ID] = varBranchID

    Its not getting selected but if i check the field in immediate window i can see the data what i expected which is not showing in combo box.
    Can some one help me how to populate the value through programatically.

    Thank you all.

    SDondeti


  2. #2
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682
    I would do a msgbox to make sure varBranchID is a valid integer that would be in the listing of the combobox rowsource and make sure that the combobox has the right column as the bound column.

    ex:
    msgbox varBranchID
    Forms![frminitialclaims]![Branch ID] = varBranchID
    msgbox Forms![frminitialclaims]![Branch ID]

    Otherwise the code looks to be correct to do what you want to do.

  3. #3
    sdondeti is offline Novice
    Windows 98/ME Access 2003
    Join Date
    Aug 2009
    Posts
    23
    I checked it. That gives me exactly what i required but it does not show or select from the combobox list.

    from Immediate window i got the result as:
    ?Forms![frminitialclaims]![Branch ID]
    EAST

    but ComboBox appear as null. what should i do to see this value ? is there any properties to be changed. Its in enable and visible. but no value appeared.

    Thank you.

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

Similar Threads

  1. Multi select list box
    By foxtet in forum Forms
    Replies: 1
    Last Post: 05-30-2011, 02:13 PM
  2. Replies: 3
    Last Post: 05-13-2011, 08:48 AM
  3. Replies: 1
    Last Post: 10-22-2010, 10:11 AM
  4. Use one subform as a select list
    By larryb43 in forum Forms
    Replies: 0
    Last Post: 02-27-2010, 03:08 PM
  5. Select value from a list box
    By Hidenite in forum Queries
    Replies: 8
    Last Post: 01-29-2010, 11:31 AM

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