Subform Requery Not Working

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

Guest

I have a form called "View Hood" that contains a textbox and subform, called
"Units subform" in datasheet view.

I would like the subform to automatically update with selected records as
the user types in a search criteria.

The subform is based on the following query:

SELECT Units.[Unit ID], Units.Building, Units.[Room #], Units.[Hood #],
Units.[Unit Comments]
FROM Units
WHERE (((Units.[Unit ID]) Like [forms]![View Hood]![Text10]));

In the "View Hood" form, the text box is named "Text10". in the OnChange
event, I've added:

[Forms]![View Hood]![Units subform].Requery

When I open up the "View Hood" form and type something in the "Text10"
textbox, absolutely nothing happens.

I'm a complete n00b at this. I'm sure I must be missing something, but I'm
just beating my head against the wall with this. Any suggestions?
 
use the afterupdate event instead &
Me.Units_subforms.form.requery

the significant change beeing .Form (instead of asking access to requery the
control)

HtH

Pieter
 
That helps alot!

Is there no way to have it update as the user type, rather than requiring a
loss of focus? I'd like it to behave like a smart search or AutoComplete.
 
Sure, put it back in the change event
I don't know wether it's a good idea though

Pieter
 
Back
Top