where to put my If Statement to update subform

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

Guest

I have a subform that is populated by a multiselect listbox (selecting
records and pressing a button) I would like to use an If statement to change
one of the fields on the records displayed:

If Me![SessionID] >= 14 And Me![SessionID] <= 16 Then
Me![Combo22] = 2
Else
Me![Combo22] = 1
End If

Is there any where (in the subform events) I can put that statement to
update all the displayed records (in one go) as the subform is populated or
do I need to change each record individually. At the moment I have it in the
On update event which works ok but I have to update each record.

I hope someone can help

Thanks

Phil
 
Is there any where (in the subform events) I can put that statement to
update all the displayed records (in one go) as the subform is populated or
do I need to change each record individually. At the moment I have it in the
On update event which works ok but I have to update each record.

Just remember that the data is NOT stored in the subform - it's stored
in a Table. You can run an Update Query with appropriate criteria to
update any number of rows in that Table, and then refresh or requery
the form to display the changed data.

John W. Vinson[MVP]
 
Back
Top