By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,705 Members | 1,852 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,705 IT Pros & Developers. It's quick & easy.

Sql recordsource from a subform

P: n/a
Hi all

Ive got a form with combo which filters a recordset using an sql statement,
and it works fine, here's the code.

mySql = "SELECT *from qryAllByArea WHERE tblInspections.Area= " & Chr(34) &
Me.cboAreaFilter & Chr(34) & " ORDER BY qryAllByArea.NcrId;"

Me.RecordSource = mySql
Me.cboNCRId.RowSource = mySql 'Im using this cbo to find records in the
Filtered set. .
Me.Requery

This works fine for me from the form.

I have dropped this form as a subform onto an unbound MainForm, (tabbed
menu) and I'm not getting the same results.
I'm not getting any error message, just not the same number of records being
returned. Funny thing is the cboNCRId has the full set,
but the subform does not display them!

Have tried it in a new form and it works.
Is there any property of the parent form or the tab control which might
restrict the number of records on the subform. ???

Have sorted it by copying the combo into a new form, and the form code.
Works fine like this. Will delete the problem form,
but would like to track down a cause.

Thanks in advance.
BTW its Access 97SR2
Gerry Abbott.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.518 / Virus Database: 316 - Release Date: 11/09/03
Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.