Hallo "s4".
s4 said:
Hi,
Just wondering if it's possible to put values in a table, using
data entered on a form?
Like if the person enters for item a, 1, then it adds 1 to item
A in a table. I've tried dlookup(blah) = me.text1 but it doesn't
work.
The data displayed in a form can come from a table or query, you can
specify the data source through the RecordSource property of the
form. You can use the wizard to create such a form, or you can create
it manually. After setting the RecordSource property, you have
several opportunities to add a data bound control to your form:
1) (easiest)
Drag a field from the field list (see the view menu) onto the form.
2) (most complicated)
Click a control type in the toolbox, then click a position on the
form. For some control types there is a wizard that can help you
to specify important properties like the field from the data source
that should be bound to the control. If there's no wizard available
(like with textboxes), you have to specify the ControlSource of the
control using the properties window.
3) (somewhere in between)
Click a tool in the toolbox, then drag a field from the field list.
This creates a control of your choice, bound to the field.
You code using dlookup can't work because DLookup returns a value
(not a field) from a table or query. Using this function means:
"Tell me the (first) value of an expression for that table/query
where certain criteria are met".
To change a value in a table via code you can either "execute" an
update query, or you can open a "recordset", locate the desired
record and edit/update the desired field ("blah"?).
Search online help for the words in quotes for details.