[AccessD] Still having a subform problem...

Christopher Hawkins clh at christopherhawkins.com
Fri Apr 16 13:55:05 CDT 2004


OK, I tried that line and it still errored out.  But it gave me an
idea - I adjusted it slightly, to this:

Me.sFrmResults(sSearchField).ColumnOrder = 1

and it worked.  So thanks for the inspiration!

Now I'm having the same error on this line:

  Me.sFrm.Form.RecordSource = "SELECT * FROM tblCustomer"

I tried re-writing it to be:

  Me.sFrm.RecordSource = "SELECT * FROM tblCustomer"

But it still error s out.  Any ideas on that one?

-Christopher-


---- Original Message ----
From: Bryan_Carbonnell at cbc.ca
To: accessd at databaseadvisors.com, 
Subject: Re: [AccessD] Still having a subform problem...
Date: Fri, 16 Apr 2004 14:25:05 -0400

>Since the command button and the sub form are on the same subform, 
>try
>
>Me.Form(sSearchField).ColumnOrder = 1
>
>Bryan Carbonnell
>bryan_carbonnell at cbc.ca
>
>>>> clh at christopherhawkins.com 16-Apr-04 2:00:46 PM >>>
>..although I looked at this page:
>
>http://www.databaseadvisors.com/newletters/newsletter032004/0310Refer
>e
>
>nceGuide/SyntaxForSubs.htm
>
>The syntax just isn't working.  So, to restate the problem:
>
>The Overview:
>
>frmMain, which has a subform control named sFrm. sFrm's SourceObject
>= "frmSearch"
>
>frmSearch, which has a button named cmdSearch and a subform control
>named sFrmResults. sFrmResults' SourceObject = "frmResults".
>
>frmResults, which has a bunch of fields like FirstName, LastName,
>etc. Typical customer database stuff. frmResults displays as a
>datasheet.
>
>The Problem:
>
>In the code behind cmdSearch, there is a line that tries to re-order
>the columns in the datasheet contained in sFrmResults. That code
>looks like this:
>
>[sFrmResults].Form(sSearchField).ColumnOrder = 1
>
>That line of code tries to execute but instead yields this error:
>
>Method 'Form' of object '_Subform' failed.
>
>Now, this is also totally vanilla, but for some reason it just won't
>work. I tried pulling frmSearch out of frmMain so that the search
>form was it's own form instead of being a subform, and this line
>worked just fine then. Unfortunately, my client will not accep that
>change as a solution; frmSearch must remain a subform. 
>
>But that line just does not work when frmSearch is a subform.
>
>-- 
>_______________________________________________
>AccessD mailing list
>AccessD at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/accessd
>Website: http://www.databaseadvisors.com
>
>





More information about the AccessD mailing list