Form Name Argument??? (1 Viewer)

omar1014

New member
Local time
Today, 16:38
Joined
Nov 29, 2006
Messages
2
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
 

Matt Greatorex

Registered User.
Local time
Today, 16:38
Joined
Jun 22, 2005
Messages
1,019
Try
Code:
DoCmd.OpenForm "pvcAirCmp1LoadCus", acFormPivotTable, "", "[qryAirComprs]![fldDATE] Between [Forms]![frmHome]![AirCmpStartDate] And [Forms]![frmHome]![AirCmpEndDate]", acNormal
 

omar1014

New member
Local time
Today, 16:38
Joined
Nov 29, 2006
Messages
2
hey, thanks alot, that got rid of myerror, but now im getting a new one saying "object required" what can i do about that?
 

Matt Greatorex

Registered User.
Local time
Today, 16:38
Joined
Jun 22, 2005
Messages
1,019
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, [B][I]""[/I][/B], "[qryAirComprs]![fldDATE] Between [Forms]![frmHome]![AirCmpStartDate] And [Forms]![frmHome]![AirCmpEndDate]", acNormal
 

Users who are viewing this thread

Top Bottom