M
Mister John Doe
I have not been able to find out from the Microsoft help information
what the answer to this is, so I thought I'd pose it here...
Unfortunately for me, this happens all the time.
I use the wizard to create a form. When I create the form I place on
it all the fields that I think I am going to need. Of course, I am
using that double-column window that the wizard presents to use. It's
really easy to do that, except for this:
I sometimes will spend hours modifying the form, placing triggers and
event handling code into the module behind the form. Then I determine
that I need another field. Maybe I didn't think about it enough when I
created the form, but there I am.
So I add another control, let's say a text box or a combo box. Then I
assign it a Control Source to the table and the field that I want to
add to the form. However, I am placing this field there because I want
to use it for creating or updating a new record (data input). So, when
I go to add data to the new field, or if I programmatically try to
assign a value to the control, I get an error message that basically
tells me I can't assign a value to the field.
I'm assuming that the problem is because when I set up the new control
to have a Control Source of a specific field from a table, then that
must be telling Access to get data FROM that field/table, and not to
allow me to put data INTO the field/table.
But if I leave the new control unbound, then I have to add code to
"manually" build a query and an SQL statement to update the data to
the field/table. Otherwise I have to trash the whole form and start
all over, adding all the triggers and event handling code, etc. (Then
later I find that I need to add ANOTHER field and I go round and round
in circles.)
I am probably wasting a lot of time doing things this way. It seems to
me there MUST be a way to add a field to a form, bind it to a table,
and use it for data input in the same manner that the other fields are
there when the wizard built the form in the first place.
Anyone got any suggestions on what I need to do?
what the answer to this is, so I thought I'd pose it here...
Unfortunately for me, this happens all the time.
I use the wizard to create a form. When I create the form I place on
it all the fields that I think I am going to need. Of course, I am
using that double-column window that the wizard presents to use. It's
really easy to do that, except for this:
I sometimes will spend hours modifying the form, placing triggers and
event handling code into the module behind the form. Then I determine
that I need another field. Maybe I didn't think about it enough when I
created the form, but there I am.
So I add another control, let's say a text box or a combo box. Then I
assign it a Control Source to the table and the field that I want to
add to the form. However, I am placing this field there because I want
to use it for creating or updating a new record (data input). So, when
I go to add data to the new field, or if I programmatically try to
assign a value to the control, I get an error message that basically
tells me I can't assign a value to the field.
I'm assuming that the problem is because when I set up the new control
to have a Control Source of a specific field from a table, then that
must be telling Access to get data FROM that field/table, and not to
allow me to put data INTO the field/table.
But if I leave the new control unbound, then I have to add code to
"manually" build a query and an SQL statement to update the data to
the field/table. Otherwise I have to trash the whole form and start
all over, adding all the triggers and event handling code, etc. (Then
later I find that I need to add ANOTHER field and I go round and round
in circles.)
I am probably wasting a lot of time doing things this way. It seems to
me there MUST be a way to add a field to a form, bind it to a table,
and use it for data input in the same manner that the other fields are
there when the wizard built the form in the first place.
Anyone got any suggestions on what I need to do?