PC Review


Reply
Thread Tools Rate Thread

After Update Event Procedure will not work

 
 
Honey
Guest
Posts: n/a
 
      15th Jan 2010
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
 
Reply With Quote
 
 
 
 
Paolo
Guest
Posts: n/a
 
      15th Jan 2010
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" 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.
>
> Honey

 
Reply With Quote
 
Honey
Guest
Posts: n/a
 
      15th Jan 2010
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" wrote:

> 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" 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.
> >
> > Honey

 
Reply With Quote
 
Paolo
Guest
Posts: n/a
 
      15th Jan 2010
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" wrote:

> 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" wrote:
>
> > 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" 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.
> > >
> > > Honey

 
Reply With Quote
 
Honey
Guest
Posts: n/a
 
      15th Jan 2010
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" wrote:

> 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" wrote:
>
> > 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" wrote:
> >
> > > 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" 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.
> > > >
> > > > Honey

 
Reply With Quote
 
Paolo
Guest
Posts: n/a
 
      15th Jan 2010
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" wrote:

> 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" wrote:
>
> > 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" wrote:
> >
> > > 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" wrote:
> > >
> > > > 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" 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.
> > > > >
> > > > > Honey

 
Reply With Quote
 
Honey
Guest
Posts: n/a
 
      15th Jan 2010
YES!!! That did it! Thank ya'll so much for the help!!

Honey

"JimBurke via AccessMonster.com" wrote:

> 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.
>
>
> Honey wrote:
> >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]
> >> > > >
> >> > > > Honey

>
> --
> Jim Burke
>
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/For...dules/201001/1
>
> .
>

 
Reply With Quote
 
Armen Stein
Guest
Posts: n/a
 
      17th Jan 2010
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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
what's wrong with before update event procedure alekm Microsoft Access Form Coding 9 24th May 2010 11:32 AM
Run a Event Procedure and Macro in the Before Update Event Frank Microsoft Access Form Coding 5 12th Jan 2008 12:50 AM
After Update Event Procedure =?Utf-8?B?Um9nZXIgQmVsbA==?= Microsoft Access Getting Started 7 29th Jun 2007 05:26 PM
My event procedure doesn't work like it did before? =?Utf-8?B?VG9t?= Microsoft Access Form Coding 5 8th Sep 2005 05:15 PM
After Update Event Procedure =?Utf-8?B?ZGVl?= Microsoft Access Forms 5 10th Jun 2005 10:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:28 AM.