Form coding error message

  • Thread starter Thread starter Eric G
  • Start date Start date
E

Eric G

I just added the following code to an OK button on a form:

If Me!cboUserID.Column(2) < 4 Then
Me!cboUserID.Column(2) = Me!cboUserID.Column(2) + 1
DoCmd.OpenForm "frmCheckList"

and I'm receiving the following error when a User with a Column(2)
value of < 4 logs in:

"Property let procedure not defined and property get procedure did not
return an object."

Would someone be able to tell me some likely reasons for this error
message?

TIA Eric
 
If Me!cboUserID.Column(2) < 4 Then
Me!cboUserID.Column(2) = Me!cboUserID.Column(2) + 1
DoCmd.OpenForm "frmCheckList"

and I'm receiving the following error when a User with a Column(2)
value of < 4 logs in:

"Property let procedure not defined and property get procedure did not
return an object."

I just fixed the problem by using the following code (which includes a
new query):

If Me!cboUserID.Column(2) < 4 Then
DoCmd.OpenForm "frmCheckList"
DoCmd.OpenQuery "CLCountQry", acNormal, acEdit

The query takes care of increasing Column(2) by +1.
Is there an easier way to put a line into the code above so a query
wouldn't be necessary? Thanks! Eric
 
Eric G said:
I just added the following code to an OK button on a form:

If Me!cboUserID.Column(2) < 4 Then
Me!cboUserID.Column(2) = Me!cboUserID.Column(2) + 1
DoCmd.OpenForm "frmCheckList"

and I'm receiving the following error when a User with a Column(2)
value of < 4 logs in:

"Property let procedure not defined and property get procedure did not
return an object."

Would someone be able to tell me some likely reasons for this error
message?

TIA Eric

That's an uninformative error message, all right, but I believe the
error is because you are trying to change the value of the Column
property of a combo box, which is a read-only property. I see from your
followup message that you solved the problem by using an update query to
change the underlying data. That is almost certainly how you have to do
it, unless cboUserID.Column(2) -- the third column in the combo box --
is the combo box's bound column.
 
That's an uninformative error message, all right, but I believe the
error is because you are trying to change the value of the Column
property of a combo box, which is a read-only property. I see from your
followup message that you solved the problem by using an update query to
change the underlying data. That is almost certainly how you have to do
it, unless cboUserID.Column(2) -- the third column in the combo box --
is the combo box's bound column.

Thanks for responding Dirk.
Well it's nice to know I figured it out correctly.
As you expected, column(0) is the bound column. Eric
 
Back
Top