#Error 451

D

DS

I have a form with a listbox on it. You choose an item and another form
opens up. This second form (Menus)is based on a query. I have this in
the on Click property on the first form (Orders).

Forms!Orders!ListCat.Column(0) = Forms!Menus!ListMenu.Column(0)

However, when I click on the first form I get this...

Error 451
property let procedjure not defined and property get procedjure did not
return object

When I go to help, its just as unclear. What does this mean in plain
English? And how do I fix it?
Thnaks
DS
 
A

Andi Mayer..

I have a form with a listbox on it. You choose an item and another form
opens up. This second form (Menus)is based on a query. I have this in
the on Click property on the first form (Orders).

Forms!Orders!ListCat.Column(0) = Forms!Menus!ListMenu.Column(0)

However, when I click on the first form I get this...

Error 451
property let procedjure not defined and property get procedjure did not
return object

When I go to help, its just as unclear. What does this mean in plain
English? And how do I fix it?
Thnaks
DS

it looks like you are using a reserved word from Access and Access is
looking for a property

I would guess its "Menus"

try:
Forms("Orders").ListCat.Column(0) = Forms("Menus").ListMenu.Column(0)

do you open the forms("Menus") before ?
 
D

DebbieG

You have this in the On Click property of the Orders form or a control on
the Orders form?


Also, if you're in the Orders form you can shorten your line to:

Me.ListCat.Column(0) = Forms!Menus!ListMenu.Column(0)

Also, I believe if you refer to a combobox or listbox it assumes Column(0),
so you can shorten it even further to:

Me.ListCat = Forms!Menus!ListMenu


|I have a form with a listbox on it. You choose an item and another form
| opens up. This second form (Menus)is based on a query. I have this in
| the on Click property on the first form (Orders).
|
| Forms!Orders!ListCat.Column(0) = Forms!Menus!ListMenu.Column(0)
|
| However, when I click on the first form I get this...
|
| Error 451
| property let procedjure not defined and property get procedjure did not
| return object
|
| When I go to help, its just as unclear. What does this mean in plain
| English? And how do I fix it?
| Thnaks
| DS
 
D

DS

Andi said:
it looks like you are using a reserved word from Access and Access is
looking for a property

I would guess its "Menus"

try:
Forms("Orders").ListCat.Column(0) = Forms("Menus").ListMenu.Column(0)

do you open the forms("Menus") before ?
I found the problem...I had the second forms control source set to a
Query with Criteria, I removed that and it worked.
Thank you Andi
DS
 
D

DS

DebbieG said:
You have this in the On Click property of the Orders form or a control on
the Orders form?


Also, if you're in the Orders form you can shorten your line to:

Me.ListCat.Column(0) = Forms!Menus!ListMenu.Column(0)

Also, I believe if you refer to a combobox or listbox it assumes Column(0),
so you can shorten it even further to:

Me.ListCat = Forms!Menus!ListMenu


|I have a form with a listbox on it. You choose an item and another form
| opens up. This second form (Menus)is based on a query. I have this in
| the on Click property on the first form (Orders).
|
| Forms!Orders!ListCat.Column(0) = Forms!Menus!ListMenu.Column(0)
|
| However, when I click on the first form I get this...
|
| Error 451
| property let procedjure not defined and property get procedjure did not
| return object
|
| When I go to help, its just as unclear. What does this mean in plain
| English? And how do I fix it?
| Thnaks
| DS
Thanks Debbie, see previous post!
Debbie, Once again, Thank You!
DS
 
K

Ken Snell [MVP]

DebbieG said:
You have this in the On Click property of the Orders form or a control on
the Orders form?


Also, if you're in the Orders form you can shorten your line to:

Me.ListCat.Column(0) = Forms!Menus!ListMenu.Column(0)

Also, I believe if you refer to a combobox or listbox it assumes
Column(0),
so you can shorten it even further to:

Me.ListCat = Forms!Menus!ListMenu


If you don't specify a property for the listbox, it assumes the Value
property, not the Column(0) property. Value is the value in the Bound
Column. The Bound Column may or may not be the zeroth (first) column, so one
should always use Column(0) if the intent is the value in the that zeroth
column.
 
K

Ken Snell [MVP]

You snipped out the part of my reply that pertains to your question:


Me.ListCat = Forms!Menus!ListMenu

If you don't specify a property for the listbox, it assumes the Value
property, not the Column(0) property. Value is the value in the Bound
Column. The Bound Column may or may not be the zeroth (first) column, so one
should always use Column(0) if the intent is the value in the that zeroth
column.


Forms!Menus!ListMenu is a shorthand way of referring to the Value property
of ListMenu:
Forms!Menus!ListMenu.Value

Value is a property of ListMenu. It is the value of the bound column. In
VBA, almost all objects have a default property, such that, if you don't
specify the property (.Value, Column(0), .ListCount, .Name, .RowSource,
etc.), then VBA uses the default property.

My reason for posting this comment was to correct the statement that was
made about Column(0) being the default property for a list box control. It's
not. Value is the default property. When the Bound Column (another property
of the list box) has a value of 1, then the Value property will give you the
value that is in Column(0) -- but this is not because Column(0) is the
default property. If the Bound Column for the list box were 3, then
Forms!Menus!ListMenu
would give you the value of Column(2), not Column(0).
--

Ken Snell
<MS ACCESS MVP>
 
D

DebbieG

You are so right.

| | > You have this in the On Click property of the Orders form or a control
on
| > the Orders form?
| >
| >
| > Also, if you're in the Orders form you can shorten your line to:
| >
| > Me.ListCat.Column(0) = Forms!Menus!ListMenu.Column(0)
| >
| > Also, I believe if you refer to a combobox or listbox it assumes
| > Column(0),
| > so you can shorten it even further to:
| >
| > Me.ListCat = Forms!Menus!ListMenu
| >
| >
|
|
| If you don't specify a property for the listbox, it assumes the Value
| property, not the Column(0) property. Value is the value in the Bound
| Column. The Bound Column may or may not be the zeroth (first) column, so
one
| should always use Column(0) if the intent is the value in the that zeroth
| column.
| --
|
| Ken Snell
| <MS ACCESS MVP>
|
|
 
K

Ken Snell [MVP]

Slight misspeak on my part....

It's not VBA that has objects with default properties...it's the ACCESS
objects themselves.

Sorry.

--

Ken Snell
<MS ACCESS MVP>
 
D

DS

Ken said:
Slight misspeak on my part....

It's not VBA that has objects with default properties...it's the ACCESS
objects themselves.

Sorry.
Thank you! It's much clearer now.
DS
 
Top