requery

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

Guest

On a subform I am using a query to list item for a combo box. for that
record on the subform once i check it off as not available(yes/no) field I
would like it to not be avaialbale for the next record in the subform. When
I go out and open the query( with the criteria in the yes/no field) - see it
not available there but on the subform shows still available - think i need
to requery somewher on the subform -on an event procedure. not sure how to
put code for requery.

any idea. would also like to reset all to available based on a a given date
or with a click of ONE button.

thanks
 
babs said:
On a subform I am using a query to list item for a combo box. for
that record on the subform once i check it off as not
available(yes/no) field I would like it to not be avaialbale for the
next record in the subform. When I go out and open the query( with
the criteria in the yes/no field) - see it not available there but on
the subform shows still available - think i need to requery somewher
on the subform -on an event procedure. not sure how to put code for
requery.

any idea. would also like to reset all to available based on a a
given date or with a click of ONE button.

Probably in the AfterUpdate event of the subform you would requery the
combo box. For example, if the combo box were named "cboMyCombo" ...

'----- start of example code -----
Private Sub Form_AfterUpdate()

Me!cboMyCombo.Requery

End Sub
'----- end of example code -----

If you allow records to be deleted from the subform, you probably also
need to requery the combo box in the subform's AfterDelConfirm event.
 
Back
Top