Combo Box

  • Thread starter Thread starter NeilCranston
  • Start date Start date
N

NeilCranston

Guest
I have created a combo box using the wizard, which looks up the key of a table,Which is a company name. When I display this on a form,it will display all the details (address) from the first entry in the table correctly. When i select another company name via the combo box the information in the combo box changes although the rest of the address information on the form does not change. How can I make the address information change with the combo box?
 
How have you set your combo up and what is it being used....

Searching for a record?
If so try the combo wizard again and selec 'Find a record in my form' option.

Or...

Updating fields in your after a selection is made?
If so then you would have to put code in the combo AfterUpdate Event to populate the fields..
e.g.
[MyField]=[ComboName].Column(1)
etc etc

Please post more details on what you want to do
 
It sounds like your form is displaying several or all of the fields from the table. It also sounds like you have changed the field containing the Key (Company Name) to a combo box. If this is so then what you have effectively done is allowed yourself to view one record and change the information that is in one field. What you realy want to do is put another text box on the form and have the control source of that text box display the key information as you change records. Are you with me? OK. The combo box should NOT have a control source . . .only a row source which displays a distinct listing of only the key values. In the "AfterUpdate" event of the combo box, place this code(modify to suit your names):
DoCmd.ApplyFilter , "[KeyFieldName] = Forms![MyFormName]![cboComboBoxName]"
Me.Refresh

[This message has been edited by zunan (edited 03-26-2001).]
 

Users who are viewing this thread

Back
Top Bottom