Combo Box problem

B

bw

The following is in the cboRoutine_BeforeUpdate Event.
What's wrong with this code? I get run time error 424, "Object
required"...on the second line.
If cboRoutine.Column(1) = "M10DAD" then
cboRoutine.Column(4) = 1 'THE ERROR IS ON THIS LINE
end if

--
 
M

Marshall Barton

bw said:
The following is in the cboRoutine_BeforeUpdate Event.
What's wrong with this code? I get run time error 424, "Object
required"...on the second line.
If cboRoutine.Column(1) = "M10DAD" then
cboRoutine.Column(4) = 1 'THE ERROR IS ON THIS LINE
end if


You can not assign anything to a column. What were you
hoping to accomplish?
 
J

John Vinson

The following is in the cboRoutine_BeforeUpdate Event.
What's wrong with this code? I get run time error 424, "Object
required"...on the second line.
If cboRoutine.Column(1) = "M10DAD" then
cboRoutine.Column(4) = 1 'THE ERROR IS ON THIS LINE
end if

The Column property of a combo box is a read-only property. You cannot
set it to 1, or to anything else.

What are you trying to accomplish?

John W. Vinson[MVP]
 
B

bw

John Vinson said:
The Column property of a combo box is a read-only property. You cannot
set it to 1, or to anything else.

What are you trying to accomplish?

John W. Vinson[MVP]

Bummer!

I'm apparently way off in the wrong direction.
I have a table tblChkDigits.
tblChkDigits originally had a table with a bunch of field...W1, W2, W3,
etc. I know this is not according to 1NF protocol, and since I want to
refer to these "like" fields as an array, I decided to go in a different
direction.
The application was working fine until I decided to go in that different
direction, but lots of code to refer to each "W" separately by name.

So I then put all these variables into a table zCDW, with the following
fields:
WID (autonumber), RoutineID(Number), DigitNum(Number), W(Number),
S(Text)

The purpose of this table is to provide "default" values that will fill
the values of "something" so that I can later refer to them as array
values.

Notice that the RoutineID in this table, which I chose to be values
dependent on the which RoutineID was specified in tblChkDigits also.
When the user (me) chooses a Routine ID from tblChkDigits, I want all
the values in table zCDW to be accessible as array values, and also to
allow me to change those values if I choose to do so.

Ideally, I do not want tblChkDigits to produce additional records for
the total records in zCDW table. In other words, Id prefer to not have
on record in tblChkDigits be multiplied times the number of records in
zCDW having a particular RoutineID. (I understand that this may not be
possible).

I'm now at a complete loss as to how to proceed. I don't know if my
table (zCDW) is properly designed, I don't know if I should use this
table, I don't know how to update tblChkDigits.

I hope I've explained what I'm after. As I said...Bummer!

bw
 
M

Marshall Barton

bw said:
Bummer!

I'm apparently way off in the wrong direction.
I have a table tblChkDigits.
tblChkDigits originally had a table with a bunch of field...W1, W2, W3,
etc. I know this is not according to 1NF protocol, and since I want to
refer to these "like" fields as an array, I decided to go in a different
direction.
The application was working fine until I decided to go in that different
direction, but lots of code to refer to each "W" separately by name.

So I then put all these variables into a table zCDW, with the following
fields:
WID (autonumber), RoutineID(Number), DigitNum(Number), W(Number),
S(Text)

The purpose of this table is to provide "default" values that will fill
the values of "something" so that I can later refer to them as array
values.

Notice that the RoutineID in this table, which I chose to be values
dependent on the which RoutineID was specified in tblChkDigits also.
When the user (me) chooses a Routine ID from tblChkDigits, I want all
the values in table zCDW to be accessible as array values, and also to
allow me to change those values if I choose to do so.

Ideally, I do not want tblChkDigits to produce additional records for
the total records in zCDW table. In other words, Id prefer to not have
on record in tblChkDigits be multiplied times the number of records in
zCDW having a particular RoutineID. (I understand that this may not be
possible).

I'm now at a complete loss as to how to proceed. I don't know if my
table (zCDW) is properly designed, I don't know if I should use this
table, I don't know how to update tblChkDigits.

I hope I've explained what I'm after. As I said...Bummer!


bw, I've read and reread the above and just can't figure out
what you're trying to do. All I can say is that you seem to
have gone way out beyond left field in an attempt to deal
with some of the problems brought on by a poor table design.
This idea of using an array just seems to be at cross
purposes with what I am familiar with as a way to deal with
data and forms.

This may be totally irrelevant, but about the only
potentially useful thing I can suggest. You can refer to
controls by using this syntax:
Me("sometext" & somenumber)
similarly, you can refer to fields in a recordset:
rs("sometext" & somenumber)

So, maybe(?) your idea of an array can be dismissed by using
code with this kind of logic:

Set rs = OpenRecordset("zCDW")
For k = 1 To 10
Me("txt" & k) = rs("fld" & k)
Next k
 
Top