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

Setting recordsource for subform

P: n/a
In a main form, I build an SQL string based on several unbound combo boxes
and then I try to set this string to be the recordsource for a subform like
this:

Private Sub cmdfind_Click()
Dim strSQL As String
strSQL = [a valid SQL string]
Me.child1.Form.RecordSource = strSQL
End Sub

I get error 2001: "You canceled the previous operation."
The button cmdfind is in the main form's header, and the subform is open but
with no recordsource when the button is first clicked.

What's wrong?
thanks in advance
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I figured it out: My sql was valid syntacically, but there was a type
mismatch ( I said "WHERE field = '2', and it was a number field). Not sure
why this error came up, but oh well.
In a main form, I build an SQL string based on several unbound combo boxes
and then I try to set this string to be the recordsource for a subform
like this:

Private Sub cmdfind_Click()
Dim strSQL As String
strSQL = [a valid SQL string]
Me.child1.Form.RecordSource = strSQL
End Sub

I get error 2001: "You canceled the previous operation."
The button cmdfind is in the main form's header, and the subform is open
but with no recordsource when the button is first clicked.

What's wrong?
thanks in advance

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.