Sub/Function not defined 
Author Message
 Sub/Function not defined

Sub/Function not defined
I'm trying to user the enclosed function to build my
report's filter criteria but as per below, the
COMMANDBARCOMBOBOX statement keeps stopping with the error
message that the "Sub or Function is not defined." Any
help would be appreciated.

'determines WHERE criteria to apply to a report.

Function buildSQL()

strSQL = "PromotionType= " & Choose(CommandBarComboBox
(filterType).ListIndex, "BE", "OA") & " and year
(mediaStartDate) like filteryear"

DoCmd.OpenReport objName, acViewPreview, , strSQL

End Function



Mon, 27 Dec 2004 03:25:29 GMT  
 Sub/Function not defined
If you actually meant a ComboBox in a CommandBar in your application, then I
*think* you need to add the Office Object Library to the References and use
fully-qualified references to the CommandBars.  Probably, it should be:

    Application.CommandBars("CmdBarName").Controls("CmdBarComboName").....

--
HTH
Van T. Dinh
MVP (Access)


Quote:
> Sub/Function not defined
> I'm trying to user the enclosed function to build my
> report's filter criteria but as per below, the
> COMMANDBARCOMBOBOX statement keeps stopping with the error
> message that the "Sub or Function is not defined." Any
> help would be appreciated.

> 'determines WHERE criteria to apply to a report.

> Function buildSQL()

> strSQL = "PromotionType= " & Choose(CommandBarComboBox
> (filterType).ListIndex, "BE", "OA") & " and year
> (mediaStartDate) like filteryear"

> DoCmd.OpenReport objName, acViewPreview, , strSQL

> End Function



Mon, 27 Dec 2004 11:31:21 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Sub/Function not defined?

2. problem: Sub or Function not defined

3. Compile Error: Sub or Function not defined

4. Help: Sub or Function not defined error

5. Compile Error Sub or function not defined

6. Sub or Function Not Defined

7. sub or function not defined

8. Sub or function not defined - DLL problem

9. Compile error, sub or function not defined

10. 'Sub or function not defined'

11. Sub- or function procedure not defined

12. Sub or Function not defined?.

 

 
Powered by phpBB® Forum Software