Object doesn't support this property or method

G

Guest

I need help with the following select case statement.

I am using an option box on the main form to filter records in the subform
and for some reason I am getting the above referenced error.

Here is the select case code:

Private Sub Comm_Grp_Frame_AfterUpdate()
'update Account Compliance History subform with selection

Dim strSQL As String

Select Case Me!Comm_Grp_Frame

Case 1 'PTA selection
strSQL = "SELECT Qry_Archive.[Data Quarter], "
strSQL = strSQL & "Qry_Archive.Terr, "
strSQL = strSQL & "Qry_Archive.[Account No] , "
strSQL = strSQL & "Qry_Archive.[Comm Gp], "
strSQL = strSQL & "Qry_Archive.GPO, "
strSQL = strSQL & "Qry_Archive.Level, "
strSQL = strSQL & "Qry_Archive.Desc, "
strSQL = strSQL & "Qry_Archive.[12 Mo Units], "
strSQL = strSQL & "Qry_Archive.[Ann Mkt Pot], "
strSQL = strSQL & "Qry_Archive.Untapped, "
strSQL = strSQL & "Qry_Archive.[80% Units], "
strSQL = strSQL & "Qry_Archive.Compliant, "
strSQL = strSQL & "Qry_Archive.Action, "
strSQL = strSQL & "Qry_Archive.New_Tier"
strSQL = strSQL & "FROM Qry_Archive"
strSQL = strSQL & "WHERE (((Qry_Archive.[Comm_Gp])= 'PTA'))"
strSQL = strSQL & "ORDER BY Qry_Archive.[Data Quarter];"
Me!Sfrm_Qry_Archive!Comm_Gp.RowSourceType = "Table/Query"
Me!Sfrm_Qry_Archive!Comm_Gp.RowSource = strSQL

Case 2 'Stents selection
strSQL = "SELECT Qry_Archive.[Data Quarter], "
strSQL = strSQL & "Qry_Archive.Terr, "
strSQL = strSQL & "Qry_Archive.[Account No] , "
strSQL = strSQL & "Qry_Archive.[Comm Gp], "
strSQL = strSQL & "Qry_Archive.GPO, "
strSQL = strSQL & "Qry_Archive.Level, "
strSQL = strSQL & "Qry_Archive.Desc, "
strSQL = strSQL & "Qry_Archive.[12 Mo Units], "
strSQL = strSQL & "Qry_Archive.[Ann Mkt Pot], "
strSQL = strSQL & "Qry_Archive.Untapped, "
strSQL = strSQL & "Qry_Archive.[80% Units], "
strSQL = strSQL & "Qry_Archive.Compliant, "
strSQL = strSQL & "Qry_Archive.Action, "
strSQL = strSQL & "Qry_Archive.New_Tier"
strSQL = strSQL & "FROM Qry_Archive"
strSQL = strSQL & "WHERE (((Qry_Archive.[Comm_Gp])= 'Stents'))"
strSQL = strSQL & "ORDER BY Qry_Archive.[Data Quarter];"
Me!Sfrm_Qry_Archive!Comm_Gp.RowSourceType = "Table/Query"
Me!Sfrm_Qry_Archive!Comm_Gp.RowSource = strSQL

End select

End sub

Thank you!
 
M

Marshall Barton

Emma said:
I need help with the following select case statement.

I am using an option box on the main form to filter records in the subform
and for some reason I am getting the above referenced error.

Here is the select case code:

Private Sub Comm_Grp_Frame_AfterUpdate()
'update Account Compliance History subform with selection

Dim strSQL As String

Select Case Me!Comm_Grp_Frame

Case 1 'PTA selection
strSQL = "SELECT Qry_Archive.[Data Quarter], " [ . . . ]
strSQL = strSQL & "WHERE (((Qry_Archive.[Comm_Gp])= 'PTA'))"
strSQL = strSQL & "ORDER BY Qry_Archive.[Data Quarter];"
Me!Sfrm_Qry_Archive!Comm_Gp.RowSourceType = "Table/Query"
Me!Sfrm_Qry_Archive!Comm_Gp.RowSource = strSQL

Case 2 'Stents selection
strSQL = "SELECT Qry_Archive.[Data Quarter], " [ . . . ]
strSQL = strSQL & "WHERE (((Qry_Archive.[Comm_Gp])= 'Stents'))"
strSQL = strSQL & "ORDER BY Qry_Archive.[Data Quarter];"
Me!Sfrm_Qry_Archive!Comm_Gp.RowSourceType = "Table/Query"
Me!Sfrm_Qry_Archive!Comm_Gp.RowSource = strSQL

End select

End sub


That reference is incomplete. It usually worked in older
versions, but A2003 is more careful about checking it. Try
using:

Me!Sfrm_Qry_Archive.FORM!Comm_Gp.RowSourceType="Table/Query"
Me!Sfrm_Qry_Archive.FORM!Comm_Gp.RowSource = strSQL
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top