-----Original Message-----
Hi May,
Now I'm confused. I really don't understand what it is that you are
trying to do (this might have something to do with it being Friday
afternoon
). What recordset are you talking about?
If you put an expression in the controlsource of a control, you can
not assign a value it later. You can either leave the control unbound
(controlsource is empty) or bind it to a field, in which case the
ControlSource would have the field name with no equals sign (=) in
front of it.
--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.
May wrote:
Actually, what I want to do is to be able to modify the
FACITLITY_NUMBER in the recordset, the FACILITY_NUMBER is
actually from a lookup table (that's why I want to list
them in the Combo LOCATIONTABLE)
That's why I a FACILITY_NUMBER field which is storing the
facility_number from the record set, and copy the value
manually (when form is loaded) to a Combo, so that user
can make changes from the dropdown list. After the Combo
is changed, I will copy the value back to FACILITY_NUMBER
field so that the recordset can be updated.
I believe this is not unusual, but I don't know what I
should do to make it happen.
Thanks.
May
-----Original Message-----
Hi May,
If you have "=LOCATIONTABLE!location" in the Controlsource of the
Combo it is a calculated control and you can not assign a new value
to it in code. Is Location a field in the Recordsource query of the
form? If so, shouldn't the combo just be bound directly to that
field?
--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this
newsgroup.
May wrote:
Thanks Sandra for getting back to me.
Below is the code to set property of the ComboBox and
assign value to the ComboBox.
FACILITY_COMBO.Enabled = True
FACILITY_COMBO.Visible = True
FACILITY_COMBO.SetFocus
FACILITY_COMBO = FACILITY_NUMBER
I'm getting the "Run-time error'-2147352567 (80020009)'"
in the assignment statement. Before the debugger steps
into the assignment statement, the
FACILITY_NUMBER.value="2099".
FACILITY_NUMBER is a field on the same form which is from
recordset of the form.
In the RowSourceType property of FACILITY_COMBO, I
put "Table/Query"
In the RowSource property of FACILITY_COMBO, I
put "SELECT
LOCATIONTABLE.location, LOCATIONTABLE.locationname
FROM LOCATIONTABLE;"
In the ControlSource property of FACILITY_COMBO, I
put "=LOCATIONTABLE!location"
I hope I've given enough info for you to understand.
Thanks for your help.
May
.
.