PC Review


Reply
Thread Tools Rate Thread

combo box method or data member not found??

 
 
Alan
Guest
Posts: n/a
 
      31st Mar 2010
This is part of my code

Sub PrintReports(ReportView As AcView)
' This procedure used in Preview_Click and Print_Click Sub procedures.
' Preview or print report selected in the ReportToPrint option group.
' Then close the Print Sales Reports Dialog form.
Dim strReportName As String
Dim strReportFilter As String
Dim lOrderCount As Long

' Determine report filtering
If Nz(Me.cbReportFilter) <> "" Then
strReportFilter = "([SalesGroupingField] = """ & Me.cbReportFilter &
""")"
End If

' Determine reporting time frame
Select Case Me.Listfilter
Case ByYear
strReportName = "Yearly Sales Report"
lOrderCount = DCountWrapper("*", "Sales Analysis", "[Posting Date
Year Financial]=" & Me.cbYear)
Case ByQuarter
strReportName = "Quarterly Sales Report"
lOrderCount = DCountWrapper("*", "Sales Analysis", "[Posting Date
Year Financial]=" & Me.cbYear & " AND [Quarter]=" & Me.cbQuarterly)

Every time i click the preview button on my form i get and error

compile erro

method or data member not found

but it work well for Yearly Sales Report, it just highlight
Quarterly sales report.

An there is a combo box name cbYear Correct spelling

any suggstions
 
Reply With Quote
 
 
 
 
Dorian
Guest
Posts: n/a
 
      31st Mar 2010
Did you isolate what statement is failing by going into debug? That should
tell you what is wrong.
Does your code compile?
You should also have error handling in ALL your proceduires and functions.
Also, it's not a good idea to have embedded spaces in the name of any Access
object (e.g. table, column , query)

You could try displaying your criteria:
Dim strSQL as string
strSQL = "[Posting Date Year Financial]=" & Me.cbYear & " AND [Quarter]=" &
Me.cbQuarterly
Msgbox strSQL

-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".


"Alan" wrote:

> This is part of my code
>
> Sub PrintReports(ReportView As AcView)
> ' This procedure used in Preview_Click and Print_Click Sub procedures.
> ' Preview or print report selected in the ReportToPrint option group.
> ' Then close the Print Sales Reports Dialog form.
> Dim strReportName As String
> Dim strReportFilter As String
> Dim lOrderCount As Long
>
> ' Determine report filtering
> If Nz(Me.cbReportFilter) <> "" Then
> strReportFilter = "([SalesGroupingField] = """ & Me.cbReportFilter &
> """)"
> End If
>
> ' Determine reporting time frame
> Select Case Me.Listfilter
> Case ByYear
> strReportName = "Yearly Sales Report"
> lOrderCount = DCountWrapper("*", "Sales Analysis", "[Posting Date
> Year Financial]=" & Me.cbYear)
> Case ByQuarter
> strReportName = "Quarterly Sales Report"
> lOrderCount = DCountWrapper("*", "Sales Analysis", "[Posting Date
> Year Financial]=" & Me.cbYear & " AND [Quarter]=" & Me.cbQuarterly)
>
> Every time i click the preview button on my form i get and error
>
> compile erro
>
> method or data member not found
>
> but it work well for Yearly Sales Report, it just highlight
> Quarterly sales report.
>
> An there is a combo box name cbYear Correct spelling
>
> any suggstions

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Method or data member not found Allen Browne Microsoft Access VBA Modules 0 9th Jul 2008 04:22 PM
Method of Data Member Not found Gaetanm via AccessMonster.com Microsoft Access Forms 6 14th Nov 2006 04:24 PM
Compile error on Combo box: Method or data member not found =?Utf-8?B?UGV0ZXIgU3RvbmU=?= Microsoft Access Form Coding 2 31st Jul 2006 02:00 AM
Method or data member not found with Move method Kate Microsoft Access Form Coding 2 1st Dec 2004 02:58 PM
Method or data member not found RB Microsoft Access Form Coding 1 3rd Jul 2003 03:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:48 PM.