Set value in unbound field

  • Thread starter Thread starter Jonathan Blitz
  • Start date Start date
J

Jonathan Blitz

I have a form displayed in continuous format.

The data is from an SQL table.

In addition I have an unbound field on the data lines.
I wish to set the value of the unbound field with values from a combo field
on the same line.

When I enter

Me.Field = Me.Combo.value

it sets the value of ALL the rows to the same.

What am I doing wrong?

--
Jonathan Blitz
AnyKey Limited
Israel

"When things seem bad
Don't worry and shout
Just count up the times
Things have worked themselves out."
 
Jonathan said:
I have a form displayed in continuous format.

The data is from an SQL table.

In addition I have an unbound field on the data lines.
I wish to set the value of the unbound field with values from a combo field
on the same line.

When I enter

Me.Field = Me.Combo.value

it sets the value of ALL the rows to the same.

What am I doing wrong?


A continuous form only has one row of controls, so setting
an unbound control in code will of course set it for all
rows. To get different values in this situation, the text
box must either be bound to a field is the form's record
source table/query OR it must have an expression that uses
other bound controls. In this case you could use the
expression = Combo.value

If you want to see the values from another column, you can
use =Combo.Column(N) where N is the combo's column
(starting at zero) you want to see.
 
Back
Top