Subform Requery Not Working

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?
 
P

Pieter Wijnen

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
 
G

Guest

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.
 
P

Pieter Wijnen

Sure, put it back in the change event
I don't know wether it's a good idea though

Pieter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top