Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Jul 2003
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ComboBox (Access 2002)

    I have a ComboBox In my Form Header; the ComboBox is used to select values and populate the information of text boxes that are also listed in the form header. My Problem; Is that the ComboBox value doesn't change to reflect/match the value of the current record when I scroll thur the records in my table. How do I get the ComboBox to change to the value of the current record?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: ComboBox (Access 2002)

    If you want the combo box to reflect/match a field in the current record, you must bind it to that field, i.e. you must set the Control Source property of the combo box to the name of the field it should match.

    But think carefully before doing so; as a consequence, the value of that field will change every time you select another item from the dropdown list part of the combo box. If that is what you intend, fine, but if you don't want that to happen, your wish seems to be contradictory.

    Also, take a good look at the Row Source, Column Widths and Bound Column properties of the combo box. The field in the Control Source should correspond to the field in the Row Source indicated by the Bould Column; this might be a hidden column (Column Width = 0).

  3. #3
    2 Star Lounger
    Join Date
    Jul 2003
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ComboBox (Access 2002)

    Thanks Hans; That's my actual problem that when I set Control Source to the one field; the value changes. What I didn't inform you was that the header information is used to link to a subform. So once the value changes the subform will not open because the link data has been changed. My concern is that my combobox looks up Unit Number and Unit Name; then I use the after update function of combobox to set the value of "Unit Number" and "Unit Name" textboxes. When my customers flow thru the Form they will look at the combobox and complain because it does not match the Unit Number and Unit Name of the textboxes. Bottom line they become confused.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: ComboBox (Access 2002)

    I become confused too. If the combo box is bound to a field, you should be able to bind the Unit Number and Unit Name to fields too, or to an expression that depends on the field the combo box is bound too. that way, the text boxes will change with the combo box and also when the user moves from record to record.

    If that is not possible, you might call the After Update procedure of the combo box from the On Current event of the form.

  5. #5
    2 Star Lounger
    Join Date
    Jul 2003
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ComboBox (Access 2002)

    Thanks Hans; but the text boxes are working fine; in fact if I create a record with combobox the textboxes are set to the appropriate values based on using the afterupdate function. In addition; if I scroll thru the form and I change the combobox value the textboxes will be changes to the new values displayed in the combobox; something I really don't want.

    All I really want is for the combobox values to match what is in the textboxes when I scroll thru the form from record to record. Thanks very much for your help.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: ComboBox (Access 2002)

    I'm getting more confused as this thread progresses. If you want the text box values to be updated from the combo box and the combo box value to change to match the text boxes, it seems to me that you have a circular reference.

    What happens as the user moves from record to record. Do the text box values change? If yes, should they change? If no, is it OK that they don't change?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •