On Fri, 15 Jan 2010 06:47:02 -0800, Honey
<(E-Mail Removed)> wrote:
>Can someone please help me. I have a form that I would like to have the Sire
>ID automatically filled in when I select the Sire's name from a combo Box.
>This is the code that I have. It seemed to work with Access 2000, but I now
>have Access 2007. Please tell me what I have left out. I don't get anything
>in the Sire ID field after I leave the Sire field. The combo box has 4
>columns, Horses name, Registration number, Other registration number and
>Horse ID.
>
>Private Sub Sire_AfterUpdate()
>SireID = [Sire].Column(3)
>End Sub
>
>Thanks for any help that you can give me.
It sounds like you solved your syntax problem, but I wanted to point
ou that if all you need to do is display one of your combobox columns
in another control, you just need to set the control's controlsource
to reference the column of the combobox. You don't need the VBA code
in the AfterUpdate event.
SireID ControlSource: =[MyCombobox].Column(3)
Armen Stein
Microsoft Access MVP
www.JStreetTech.com