I think your subform is bound to a query that contains criteria such as:
Forms!YourMainForm!SomeTextbox
and the problem is that this does not always load/stay up to date correctly.
Would it be possible to use the LinkMasterFields/LinkChildFields properties
of the subform instead? That should make life simpler if it is possible, and
it works for most things unless you are choosing a range rather a discreet
value (e.g. from start date to end date), or trying to get all values when
some of the controls in the linkage may be null.
Another alternative is to reassign the RecordSource of the subform in the
Current event of the main form. By creating a SQL string that concatenates
any literal values into the string, you can handle ranges, ignore nulls, and
get the exact result you want. You may need to check that Access does not
become overhelpful and decide to assign values to the
LinkMasterFields/LinkChildFields based on the new RecordSource. And you also
have to be careful to avoid cyclic dependencies, such as something in the
main form that is dependent on something in the subform. Conditional
formatting can also trigger this.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Dave Boyd" <da**********@boeing.com> wrote in message
news:e7*************************@posting.google.co m...
I have two very similar forms each with a subform. The main form gets
a few fields from the user and passes this back to a query that the
subform is bound to. The requery is done when the user enters the
last qualifying field on the main form.
In one case this works fine, the subform shows the data the user wants
to update -- which means showing all the data put in previously (ie
showing this via the requery and the continuous option on the subform)
and standing by for input. In the other case, the requery refuses to
display in the continuous subform showing one blank record (really a
partial record). With the parent form filled in, I can manually
trigger the query and see it has the correct records.
Does anyone know of some obscure setting or restriction that I need to
tweak to get the blasted thing to work?
Thanks,
Dave