forms, query and filters

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that select the data from an underlying table based on a few
conmbo boxes.

I type in what i want to find in each combo box, click a button and the form
then displays all therecords with the combiniation of the combo box entries.

I then want to update one field to a new value on only these selected
records. currently it updates all the re cord in the table, as well as the
selected ones.

how can i write a query that updates only those records that the form filter
system selected. there are several possible filter boxes or fields to choose
from, and one or more will be selected as choices.

pat
 
In a bound form (the Access default) you edit directly on the form. You do
not need to use an update query.

If you want to update values in a table using a value from a form, use 2
recordsets, the form's recordsetclone to get the value, and a recordset
created from a sql statement to find the records to update.
 
Patrick said:
I have a form that select the data from an underlying table based on a few
conmbo boxes.

I type in what i want to find in each combo box, click a button and the form
then displays all therecords with the combiniation of the combo box entries.

I then want to update one field to a new value on only these selected
records. currently it updates all the re cord in the table, as well as the
selected ones.

how can i write a query that updates only those records that the form filter
system selected. there are several possible filter boxes or fields to choose
from, and one or more will be selected as choices.


You need to construct the UPDATE query in a VBA procedure (a
button's Click event?) using the same criteria that was used
to filter the form.

If that's too vague for you, then you woll have to provife
more information about how/where you are running the query
and what you are doing to filter the form.
 
Back
Top