Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Access
3rdpartyusrgrp
access
activexcontrol
adp.sqlserver
commandbarsui
conversion
dataaccess.pages
developers.toolkitode
devtoolkits
externaldata
forms
formscoding
gettingstarted
internet
interopoledde
macros
modulescoding
modulesdaovba
modulesdaovba.ado
multiuser
odbcclientsvr
queries
replication
reports
security
setupconfig
tablesdbdesign
  
 
date: Mon, 29 Sep 2008 09:52:05 -0700,    group: microsoft.public.access.formscoding        back       


Use of RecordSet   
I am having some difficulty geeting the RecordSet property to work.  I am 
trying to use ONE form to display records differently rather than creating 
separate forms and subforms.  My form is titled frmGrouping and has its 
RecordSet as qryGrouping.    I want to change the Recordset to 
"qryProductGrpPads" when the form opens.  The only difference in the two 
queries is one table that I build prior to opening the form.  I have the 
following code attached to a Command button on a Form used to call the form.

On Error GoTo Err_Alternates_Click
    Dim strDoc As String
    Dim strDoc1 As String
    Dim strDoc2 As String
    
    strDoc = "qryMakeTableGrpPads"
    strDoc1 = "frmGrouping"
    strDoc2 = "qryProductGrpPads"
    
    DoCmd.SetWarnings False
    DoCmd.OpenQuery strDoc, acNormal, acEdit
    DoCmd.OpenForm strDoc1, acNormal, "", "", , acNormal
    Me.RecordSource = strDoc2
    DoCmd.SetWarnings True
    
Exit_Alternates_Click:
    Exit Sub

Err_Alternates_Click:
    MsgBox Err.Description
    Resume Exit_Alternates_Click

The form is opening BLANK; The Recordset is not substituing in place of the 
one defined in the form properties.  Any help appreciated.
date: Mon, 29 Sep 2008 09:52:05 -0700   author:   NEWER USER

RE: Use of RecordSet   
I meant to write RecordSource and not RecordSet

"NEWER USER" wrote:

> I am having some difficulty geeting the RecordSet property to work.  I am 
> trying to use ONE form to display records differently rather than creating 
> separate forms and subforms.  My form is titled frmGrouping and has its 
> RecordSet as qryGrouping.    I want to change the Recordset to 
> "qryProductGrpPads" when the form opens.  The only difference in the two 
> queries is one table that I build prior to opening the form.  I have the 
> following code attached to a Command button on a Form used to call the form.
> 
> On Error GoTo Err_Alternates_Click
>     Dim strDoc As String
>     Dim strDoc1 As String
>     Dim strDoc2 As String
>     
>     strDoc = "qryMakeTableGrpPads"
>     strDoc1 = "frmGrouping"
>     strDoc2 = "qryProductGrpPads"
>     
>     DoCmd.SetWarnings False
>     DoCmd.OpenQuery strDoc, acNormal, acEdit
>     DoCmd.OpenForm strDoc1, acNormal, "", "", , acNormal
>     Me.RecordSource = strDoc2
>     DoCmd.SetWarnings True
>     
> Exit_Alternates_Click:
>     Exit Sub
> 
> Err_Alternates_Click:
>     MsgBox Err.Description
>     Resume Exit_Alternates_Click
> 
> The form is opening BLANK; The Recordset is not substituing in place of the 
> one defined in the form properties.  Any help appreciated.
date: Mon, 29 Sep 2008 10:20:00 -0700   author:   NEWER USER

RE: Use of RecordSet   
Try:

DoCmd.SetWarnings False
DoCmd.OpenQuery strDoc, acNormal, acEdit
DoCmd.OpenForm strDoc1, acNormal
me.recordsource=""
Me.RecordSource = "qryProductGrpPads"
DoCmd.SetWarnings True


hth
-- 
Maurice Ausum


"NEWER USER" wrote:

> I am having some difficulty geeting the RecordSet property to work.  I am 
> trying to use ONE form to display records differently rather than creating 
> separate forms and subforms.  My form is titled frmGrouping and has its 
> RecordSet as qryGrouping.    I want to change the Recordset to 
> "qryProductGrpPads" when the form opens.  The only difference in the two 
> queries is one table that I build prior to opening the form.  I have the 
> following code attached to a Command button on a Form used to call the form.
> 
> On Error GoTo Err_Alternates_Click
>     Dim strDoc As String
>     Dim strDoc1 As String
>     Dim strDoc2 As String
>     
>     strDoc = "qryMakeTableGrpPads"
>     strDoc1 = "frmGrouping"
>     strDoc2 = "qryProductGrpPads"
>     
>     DoCmd.SetWarnings False
>     DoCmd.OpenQuery strDoc, acNormal, acEdit
>     DoCmd.OpenForm strDoc1, acNormal, "", "", , acNormal
>     Me.RecordSource = strDoc2
>     DoCmd.SetWarnings True
>     
> Exit_Alternates_Click:
>     Exit Sub
> 
> Err_Alternates_Click:
>     MsgBox Err.Description
>     Resume Exit_Alternates_Click
> 
> The form is opening BLANK; The Recordset is not substituing in place of the 
> one defined in the form properties.  Any help appreciated.
date: Mon, 29 Sep 2008 14:09:01 -0700   author:   Maurice

RE: Use of RecordSet   
Same Result - Blank Form-no records

"Maurice" wrote:

> Try:
> 
> DoCmd.SetWarnings False
> DoCmd.OpenQuery strDoc, acNormal, acEdit
> DoCmd.OpenForm strDoc1, acNormal
> me.recordsource=""
> Me.RecordSource = "qryProductGrpPads"
> DoCmd.SetWarnings True
> 
> 
> hth
> -- 
> Maurice Ausum
> 
> 
> "NEWER USER" wrote:
> 
> > I am having some difficulty geeting the RecordSet property to work.  I am 
> > trying to use ONE form to display records differently rather than creating 
> > separate forms and subforms.  My form is titled frmGrouping and has its 
> > RecordSet as qryGrouping.    I want to change the Recordset to 
> > "qryProductGrpPads" when the form opens.  The only difference in the two 
> > queries is one table that I build prior to opening the form.  I have the 
> > following code attached to a Command button on a Form used to call the form.
> > 
> > On Error GoTo Err_Alternates_Click
> >     Dim strDoc As String
> >     Dim strDoc1 As String
> >     Dim strDoc2 As String
> >     
> >     strDoc = "qryMakeTableGrpPads"
> >     strDoc1 = "frmGrouping"
> >     strDoc2 = "qryProductGrpPads"
> >     
> >     DoCmd.SetWarnings False
> >     DoCmd.OpenQuery strDoc, acNormal, acEdit
> >     DoCmd.OpenForm strDoc1, acNormal, "", "", , acNormal
> >     Me.RecordSource = strDoc2
> >     DoCmd.SetWarnings True
> >     
> > Exit_Alternates_Click:
> >     Exit Sub
> > 
> > Err_Alternates_Click:
> >     MsgBox Err.Description
> >     Resume Exit_Alternates_Click
> > 
> > The form is opening BLANK; The Recordset is not substituing in place of the 
> > one defined in the form properties.  Any help appreciated.
date: Mon, 29 Sep 2008 15:04:01 -0700   author:   NEWER USER

Re: Use of RecordSet   
On Mon, 29 Sep 2008 15:04:01 -0700, NEWER USER
 wrote:

>Same Result - Blank Form-no records
>
>"Maurice" wrote:
>
>> Try:
>> 
>> DoCmd.SetWarnings False
>> DoCmd.OpenQuery strDoc, acNormal, acEdit
>> DoCmd.OpenForm strDoc1, acNormal
>> me.recordsource=""
>> Me.RecordSource = "qryProductGrpPads"
>> DoCmd.SetWarnings True

Have you verified that qryProductGrpPads does in fact return records? If it
does not, and if it is not updateable (a grouped query won't be), you'll get a
totally blank form. What do you see when you open the query in datasheet view?

-- 

             John W. Vinson [MVP]
date: Mon, 29 Sep 2008 20:57:51 -0600   author:   John W. Vinson

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us