Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 11-29-2006, 10:39 AM   #1
omar1014
Registered User
 
Join Date: Nov 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
omar1014 is on a distinguished road
Unhappy Form Name Argument???

Hi everyone,
this is my coding for a pivot table, and everytime i got put in my required dates, i get an error stating "The action or method requires form name argument" I know you cant tell much from looking at my code, but would you know ehre my problem could possibly be?

Thank in advance




If (Forms!frmHome!AirCmpOption = 12) Then
Dim fst1 As PivotFieldSet
Dim frm1 As String

DoCmd.OpenForm pvcAirCmp1LoadCus, acFormPivotTable, "", "[qryAirComprs]![fldDATE] Between [Forms]![frmHome]![AirCmpStartDate] And [Forms]![frmHome]![AirCmpEndDate]", acNormal
DoCmd.Maximize
With frml.PivotTable.ActiveView
Set frml = Forms.Item(pvcAirCmp1LoadCus)
Set fst1 = .FieldSets("[fldDATE By Month]").Field("Months")
.RowAxis.InsertFieldSet fst1

End With
End If

omar1014 is offline   Reply With Quote
Old 11-29-2006, 10:47 AM   #2
Matt Greatorex
Registered User
 
Matt Greatorex's Avatar
 
Join Date: Jun 2005
Location: Ontario, Canada (formerly Cardiff, Wales.)
Posts: 1,019
Thanks: 0
Thanked 1 Time in 1 Post
Matt Greatorex is on a distinguished road
Try
Code:
DoCmd.OpenForm "pvcAirCmp1LoadCus", acFormPivotTable, "", "[qryAirComprs]![fldDATE] Between [Forms]![frmHome]![AirCmpStartDate] And [Forms]![frmHome]![AirCmpEndDate]", acNormal
Matt Greatorex is offline   Reply With Quote
Old 11-30-2006, 03:49 AM   #3
omar1014
Registered User
 
Join Date: Nov 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
omar1014 is on a distinguished road
hey, thanks alot, that got rid of myerror, but now im getting a new one saying "object required" what can i do about that?

omar1014 is offline   Reply With Quote
Old 11-30-2006, 04:49 AM   #4
Matt Greatorex
Registered User
 
Matt Greatorex's Avatar
 
Join Date: Jun 2005
Location: Ontario, Canada (formerly Cardiff, Wales.)
Posts: 1,019
Thanks: 0
Thanked 1 Time in 1 Post
Matt Greatorex is on a distinguished road
I think it's because you don't need the double-quotes if you don't have a filter. As long as thr right number of commas are present, a space is fine e.g.
Code:
DoCmd.OpenForm pvcAirCmp1LoadCus, acFormPivotTable, , "[qryAirComprs]![fldDATE] Between [Forms]![frmHome]![AirCmpStartDate] And [Forms]![frmHome]![AirCmpEndDate]", acNormal
instead of
Code:
DoCmd.OpenForm pvcAirCmp1LoadCus, acFormPivotTable, "", "[qryAirComprs]![fldDATE] Between [Forms]![frmHome]![AirCmpStartDate] And [Forms]![frmHome]![AirCmpEndDate]", acNormal

Matt Greatorex is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Update form to 2nd form record amerfeld Forms 5 08-30-2005 09:15 AM
Assigning value from one form to another filo77 Forms 2 08-15-2004 07:01 PM
Sub form requery problem michaellysons Forms 1 05-14-2004 04:59 AM
Problems closing form Malcy Forms 2 06-19-2003 11:41 AM
add record to sub sub form? hilbertm Forms 0 10-12-2001 02:38 PM




All times are GMT -8. The time now is 04:12 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
(c) copyright 2010 Access World