Combo box default value multiautocomplete

  • Thread starter Diego via AccessMonster.com
  • Start date
D

Diego via AccessMonster.com

Hi All
i have a subform with 10 item. The first one is a combo box that can choose
the value from a list that is linked to a table with many record.
This subform is related to the master form with

link master field codice,cognome,nome
link child field codice,cognome,nome

that are the other items that are not visualize in the subform. These link
give me the right connection to the master form.

Normally when i choose the value from list (table) i place also all the other
item in the subform using this code in after update precedure

Me.ISEE.Value = Me.ISEE.Column(0)
Me.F_Costo_con_Mensa_I_Figlio.Value = Me.ISEE.Column(1)
Me.F_Costo_con_Mensa_II_Figlio.Value = Me.ISEE.Column(2)
Me.F_Costo_con_Mensa_III_Figlio.Value = Me.ISEE.Column(3)
Me.F_Costo_senza_Mensa_I_Figlio.Value = Me.ISEE.Column(4)
Me.F_Costo_senza_Mensa_II_Figlio.Value = Me.ISEE.Column(5)
Me.F_Costo_senza_Mensa_III_Figlio.Value = Me.ISEE.Column(6)
Me.Costo_Soggiorno.Value = Me.ISEE.Column(7)
Me.Costo_Soggiorno_II_Figlio.Value = Me.ISEE.Column(8)
Me.Costo_Soggiorno_III_Figlio.Value = Me.ISEE.Column(9)

this work fine and when i choose ISEE value from the combo list all the items
of the subform have the good value.
The problem arrive when i try to use a default value in the combo box, infact
when i put
[ISEE].[itemData](0)
in the default value of the combo box ,i have the correct value but all the
other item are zero!!!!
I need always to re-choose the value in the combo box to have all item with
the correct value.

How can avoid this fastidious effect ?

Thank you in advance for your help
 
M

Marshall Barton

Diego said:
i have a subform with 10 item. The first one is a combo box that can choose
the value from a list that is linked to a table with many record.
This subform is related to the master form with

link master field codice,cognome,nome
link child field codice,cognome,nome

that are the other items that are not visualize in the subform. These link
give me the right connection to the master form.

Normally when i choose the value from list (table) i place also all the other
item in the subform using this code in after update precedure

Me.ISEE.Value = Me.ISEE.Column(0)
Me.F_Costo_con_Mensa_I_Figlio.Value = Me.ISEE.Column(1)
Me.F_Costo_con_Mensa_II_Figlio.Value = Me.ISEE.Column(2)
Me.F_Costo_con_Mensa_III_Figlio.Value = Me.ISEE.Column(3)
Me.F_Costo_senza_Mensa_I_Figlio.Value = Me.ISEE.Column(4)
Me.F_Costo_senza_Mensa_II_Figlio.Value = Me.ISEE.Column(5)
Me.F_Costo_senza_Mensa_III_Figlio.Value = Me.ISEE.Column(6)
Me.Costo_Soggiorno.Value = Me.ISEE.Column(7)
Me.Costo_Soggiorno_II_Figlio.Value = Me.ISEE.Column(8)
Me.Costo_Soggiorno_III_Figlio.Value = Me.ISEE.Column(9)

this work fine and when i choose ISEE value from the combo list all the items
of the subform have the good value.
The problem arrive when i try to use a default value in the combo box, infact
when i put
[ISEE].[itemData](0)
in the default value of the combo box ,i have the correct value but all the
other item are zero!!!!


Use the form's Current event:

If Me.NewRecord Then
Me.F_Costo_con_Mensa_I_Figlio = _
Me.ISEE.Column(1,ISEE.ListIndex)
Me.F_Costo_con_Mensa_II_Figlio = _
Me.ISEE.Column(2,ISEE.ListIndex)
. . .
End If

If all those controls are unbound then you probably don't
want the line:
If Me.NewRecord Then

Also, the line:
Me.ISEE.Value = Me.ISEE.Column(0)
serves no purpose and should be removed.
 
D

Diego via AccessMonster.com

Great it works !!!!!

Thank you very very much !!!

Diego

Marshall said:
i have a subform with 10 item. The first one is a combo box that can choose
the value from a list that is linked to a table with many record.
[quoted text clipped - 27 lines]
in the default value of the combo box ,i have the correct value but all the
other item are zero!!!!

Use the form's Current event:

If Me.NewRecord Then
Me.F_Costo_con_Mensa_I_Figlio = _
Me.ISEE.Column(1,ISEE.ListIndex)
Me.F_Costo_con_Mensa_II_Figlio = _
Me.ISEE.Column(2,ISEE.ListIndex)
. . .
End If

If all those controls are unbound then you probably don't
want the line:
If Me.NewRecord Then

Also, the line:
Me.ISEE.Value = Me.ISEE.Column(0)
serves no purpose and should be removed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top