expression error

D

David

Hello,

MSAccess 2003 - Win2K

I am getting the follow error

"The expression On Change you entered as the event
property setting produced the following error: Object or
class does not support the set of events.

* The expression may not result in the name of a macro,
the name of a user-defined function, or [Event Procedure].
* There may have been an error evaluating the function,
event or macro."

Here is the VB code in the event procedure

Private Sub Combo0_Change()
Combo2.RowSource = "Select Distinct Cities from tblCounty
Where County ='" & Combo0.Text & "'"
End Sub

The event prodecedure runs when a county is selected from
a combo box list "Combo" and populates a "City" combo
box "Combo2" with the only those cities associated with
the selected county.

Please note, this had been working in the form until I
copied the database this morning to a cdr. It also worth
mentioning that the same event procedure is working on two
other forms in the database and the VB code is the same.

Help in troubleshooting this bug is greatly appreciated.

my email is (e-mail address removed)

Thanks
 
F

fredg

Hello,

MSAccess 2003 - Win2K

I am getting the follow error

"The expression On Change you entered as the event
property setting produced the following error: Object or
class does not support the set of events.

* The expression may not result in the name of a macro,
the name of a user-defined function, or [Event Procedure].
* There may have been an error evaluating the function,
event or macro."

Here is the VB code in the event procedure

Private Sub Combo0_Change()
Combo2.RowSource = "Select Distinct Cities from tblCounty
Where County ='" & Combo0.Text & "'"
End Sub

The event prodecedure runs when a county is selected from
a combo box list "Combo" and populates a "City" combo
box "Combo2" with the only those cities associated with
the selected county.

Please note, this had been working in the form until I
copied the database this morning to a cdr. It also worth
mentioning that the same event procedure is working on two
other forms in the database and the VB code is the same.

Help in troubleshooting this bug is greatly appreciated.

my email is (e-mail address removed)

Thanks

It may be VB code but it's not Access VBA code.
In Access, you would refer to the controls Value property, not it's
Text property. Since the Value property is the default property, you
do not need to specify it.

Also, you've placed it in the wrong event.
The change event fires as you enter each character, whereas you need
to wait until the entire value has been entered or selected.

In the Combo Box AfterUpdate event:
Combo2.RowSource = "Select Distinct Cities from tblCounty
Where [County] ='" & Combo0 & "'"
 
D

David

Fred,

Thanks for your help. I did exactly what you suggested
and I am still getting the same error message. I changed
the VBA code in each event procedure county combo box for
each form and it is still just the one form that is giving
me the error.

Any other ideas?

Thank you in advance.

David
-----Original Message-----
Hello,

MSAccess 2003 - Win2K

I am getting the follow error

"The expression On Change you entered as the event
property setting produced the following error: Object or
class does not support the set of events.

* The expression may not result in the name of a macro,
the name of a user-defined function, or [Event Procedure].
* There may have been an error evaluating the function,
event or macro."

Here is the VB code in the event procedure

Private Sub Combo0_Change()
Combo2.RowSource = "Select Distinct Cities from tblCounty
Where County ='" & Combo0.Text & "'"
End Sub

The event prodecedure runs when a county is selected from
a combo box list "Combo" and populates a "City" combo
box "Combo2" with the only those cities associated with
the selected county.

Please note, this had been working in the form until I
copied the database this morning to a cdr. It also worth
mentioning that the same event procedure is working on two
other forms in the database and the VB code is the same.

Help in troubleshooting this bug is greatly appreciated.

my email is (e-mail address removed)

Thanks

It may be VB code but it's not Access VBA code.
In Access, you would refer to the controls Value property, not it's
Text property. Since the Value property is the default property, you
do not need to specify it.

Also, you've placed it in the wrong event.
The change event fires as you enter each character, whereas you need
to wait until the entire value has been entered or selected.

In the Combo Box AfterUpdate event:
Combo2.RowSource = "Select Distinct Cities from tblCounty
Where [County] ='" & Combo0 & "'"


--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.
 
F

fredg

Fred,

Thanks for your help. I did exactly what you suggested
and I am still getting the same error message. I changed
the VBA code in each event procedure county combo box for
each form and it is still just the one form that is giving
me the error.

Any other ideas?

Thank you in advance.

David
-----Original Message-----
Hello,

MSAccess 2003 - Win2K

I am getting the follow error

"The expression On Change you entered as the event
property setting produced the following error: Object or
class does not support the set of events.

* The expression may not result in the name of a macro,
the name of a user-defined function, or [Event Procedure].
* There may have been an error evaluating the function,
event or macro."

Here is the VB code in the event procedure

Private Sub Combo0_Change()
Combo2.RowSource = "Select Distinct Cities from tblCounty
Where County ='" & Combo0.Text & "'"
End Sub

The event prodecedure runs when a county is selected from
a combo box list "Combo" and populates a "City" combo
box "Combo2" with the only those cities associated with
the selected county.

Please note, this had been working in the form until I
copied the database this morning to a cdr. It also worth
mentioning that the same event procedure is working on two
other forms in the database and the VB code is the same.

Help in troubleshooting this bug is greatly appreciated.

my email is (e-mail address removed)

Thanks

It may be VB code but it's not Access VBA code.
In Access, you would refer to the controls Value property, not it's
Text property. Since the Value property is the default property, you
do not need to specify it.

Also, you've placed it in the wrong event.
The change event fires as you enter each character, whereas you need
to wait until the entire value has been entered or selected.

In the Combo Box AfterUpdate event:
Combo2.RowSource = "Select Distinct Cities from tblCounty
Where [County] ='" & Combo0 & "'"


--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.

Did you place the code in the Combo0 AfterUpdate code window or ON the
AfterUpdate event line.
It belongs in the code window.

On the AfterUpdate event line write [Event Procedure]
Click on the button with 3 dots that appears.
The cursor will flash between 2 already existing lines of code.
Between those 2 lines, write (on one line):

Combo2.RowSource = "Select Distinct Cities from tblCounty
Where [County] ='" & Combo0 & "'"

The above assumes the value of the Bound column of the combo box is
text.
If the bound column is a Number datatype, then use
Where [County] =" & Combo0
 
D

David

-----Original Message-----
Fred,

Thanks for your help. I did exactly what you suggested
and I am still getting the same error message. I changed
the VBA code in each event procedure county combo box for
each form and it is still just the one form that is giving
me the error.

Any other ideas?

Thank you in advance.

David
-----Original Message-----
On Thu, 23 Sep 2004 14:47:16 -0700, David wrote:

Hello,

MSAccess 2003 - Win2K

I am getting the follow error

"The expression On Change you entered as the event
property setting produced the following error: Object or
class does not support the set of events.

* The expression may not result in the name of a macro,
the name of a user-defined function, or [Event Procedure].
* There may have been an error evaluating the function,
event or macro."

Here is the VB code in the event procedure

Private Sub Combo0_Change()
Combo2.RowSource = "Select Distinct Cities from tblCounty
Where County ='" & Combo0.Text & "'"
End Sub

The event prodecedure runs when a county is selected from
a combo box list "Combo" and populates a "City" combo
box "Combo2" with the only those cities associated with
the selected county.

Please note, this had been working in the form until I
copied the database this morning to a cdr. It also worth
mentioning that the same event procedure is working
on
two
other forms in the database and the VB code is the same.

Help in troubleshooting this bug is greatly appreciated.

my email is (e-mail address removed)

Thanks

It may be VB code but it's not Access VBA code.
In Access, you would refer to the controls Value property, not it's
Text property. Since the Value property is the default property, you
do not need to specify it.

Also, you've placed it in the wrong event.
The change event fires as you enter each character, whereas you need
to wait until the entire value has been entered or selected.

In the Combo Box AfterUpdate event:
Combo2.RowSource = "Select Distinct Cities from tblCounty
Where [County] ='" & Combo0 & "'"


--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.

Did you place the code in the Combo0 AfterUpdate code window or ON the
AfterUpdate event line.
It belongs in the code window.

On the AfterUpdate event line write [Event Procedure]
Click on the button with 3 dots that appears.
The cursor will flash between 2 already existing lines of code.
Between those 2 lines, write (on one line):

Combo2.RowSource = "Select Distinct Cities from tblCounty
Where [County] ='" & Combo0 & "'"

The above assumes the value of the Bound column of the combo box is
text.
If the bound column is a Number datatype, then use
Where [County] =" & Combo0

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.

Yes,

The vba code line is in the Afterupdate code window and I
am still getting the error.

David
 

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