After Update Event Procedure will not work

H

Honey

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.

Honey
 
P

Paolo

Hi Honey,
It's weird that your code doesn't work 'cause it seems correct to me.
You can try to run a compact & repair on your database. Perhaps something
got corrupted during the conversion from access2k

HTH Paolo
 
H

Honey

Actually, I did not convert my database from the older version. I had some
issues, so I was rebuilding it. Any other sugestions?

Thanks,
Honey

Paolo said:
Hi Honey,
It's weird that your code doesn't work 'cause it seems correct to me.
You can try to run a compact & repair on your database. Perhaps something
got corrupted during the conversion from access2k

HTH Paolo

Honey said:
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.

Honey
 
P

Paolo

Well I can just give you some trivial suggestions because, as I said
previously, your code is correct.
The field where you wanna the SireID is called exactly SireID? The combo is
set with 4 columns and just the first one is visible(i.e. in the column
widths the first one is<>0 and the other three are zero)?

Cheers Paolo

Honey said:
Actually, I did not convert my database from the older version. I had some
issues, so I was rebuilding it. Any other sugestions?

Thanks,
Honey

Paolo said:
Hi Honey,
It's weird that your code doesn't work 'cause it seems correct to me.
You can try to run a compact & repair on your database. Perhaps something
got corrupted during the conversion from access2k

HTH Paolo

Honey said:
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.

Honey
 
H

Honey

Actually, I went back and checked the names and there is a space between Sire
and ID, I corrected that and then I got a error message that said

Compile Error:
Invalid use of property

And, all 4 columns are visible in the combo because I need to see all of
them to determine which horse to select. The horse ID column is the last one.

Thank you very much for your help.
Honey

Paolo said:
Well I can just give you some trivial suggestions because, as I said
previously, your code is correct.
The field where you wanna the SireID is called exactly SireID? The combo is
set with 4 columns and just the first one is visible(i.e. in the column
widths the first one is<>0 and the other three are zero)?

Cheers Paolo

Honey said:
Actually, I did not convert my database from the older version. I had some
issues, so I was rebuilding it. Any other sugestions?

Thanks,
Honey

Paolo said:
Hi Honey,
It's weird that your code doesn't work 'cause it seems correct to me.
You can try to run a compact & repair on your database. Perhaps something
got corrupted during the conversion from access2k

HTH Paolo

:

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.

Honey
 
P

Paolo

Well so now the textbox is called SireID and the combo Sire right?
on which line the error raise? You can try in this way

SireID = Sire.Column(3)

Paolo

Honey said:
Actually, I went back and checked the names and there is a space between Sire
and ID, I corrected that and then I got a error message that said

Compile Error:
Invalid use of property

And, all 4 columns are visible in the combo because I need to see all of
them to determine which horse to select. The horse ID column is the last one.

Thank you very much for your help.
Honey

Paolo said:
Well I can just give you some trivial suggestions because, as I said
previously, your code is correct.
The field where you wanna the SireID is called exactly SireID? The combo is
set with 4 columns and just the first one is visible(i.e. in the column
widths the first one is<>0 and the other three are zero)?

Cheers Paolo

Honey said:
Actually, I did not convert my database from the older version. I had some
issues, so I was rebuilding it. Any other sugestions?

Thanks,
Honey

:

Hi Honey,
It's weird that your code doesn't work 'cause it seems correct to me.
You can try to run a compact & repair on your database. Perhaps something
got corrupted during the conversion from access2k

HTH Paolo

:

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.

Honey
 
J

JimBurke via AccessMonster.com

It sounds like you're saying the field name has a space in it, which you
didn't have there intially. If that's the case, you always must put the field
name in brackets, e.g. [Sire ID] = x. Coding
Sire ID = x will give you a compile error.

Actually, I went back and checked the names and there is a space between Sire
and ID, I corrected that and then I got a error message that said

Compile Error:
Invalid use of property

And, all 4 columns are visible in the combo because I need to see all of
them to determine which horse to select. The horse ID column is the last one.

Thank you very much for your help.
Honey
Well I can just give you some trivial suggestions because, as I said
previously, your code is correct.
[quoted text clipped - 32 lines]
 
H

Honey

YES!!! That did it! Thank ya'll so much for the help!!

Honey

JimBurke via AccessMonster.com said:
It sounds like you're saying the field name has a space in it, which you
didn't have there intially. If that's the case, you always must put the field
name in brackets, e.g. [Sire ID] = x. Coding
Sire ID = x will give you a compile error.

Actually, I went back and checked the names and there is a space between Sire
and ID, I corrected that and then I got a error message that said

Compile Error:
Invalid use of property

And, all 4 columns are visible in the combo because I need to see all of
them to determine which horse to select. The horse ID column is the last one.

Thank you very much for your help.
Honey
Well I can just give you some trivial suggestions because, as I said
previously, your code is correct.
[quoted text clipped - 32 lines]

--
Jim Burke




.
 
A

Armen Stein

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
 

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