Monthly Report

goju

Registered User.
Local time
Today, 13:07
Joined
Apr 7, 2005
Messages
77
ok i think i know what i need (searching the forums gave me the idea)


i have query that generates a report, i need this report to be flitered monthly

is it possible to have afield where i enter the month so when i press the monthly report button it just prints any entries in that month

please can someone oint me in the right direction.
 
Put this in a new field in the query grid

Code:
Format([YourDateField],"mmm")

then in the criteria of that new field put

Code:
[Enter month (mmm)]

That'll give you the records for that month. If you want the year also do this

Code:
Format([DateObtainedPractical],"mmm/yy")

then in the criteria of that new field put

Code:
[Enter month (mmm/yy)]

Col
 
ta col,


ANy idea why the command button errors at: theId = ctl.Column(0, v)

im trying to select a date in a list box from expr query you gave me have this script below but keeps erroring at the above script.

any ideas what it is.

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'The first column in the list, holding SupplierID, is hidden.
'See the list's "Column Widths" and "Column Count" properties in
'its property dialog and look up the terms in Help for more info.
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'Coordinates: 1st column (0); row v
'where v changes for each round of the loop.
theId = ctl.Column(0, v)
'Tag on to string.
WhereCrit = WhereCrit & theId & " OR Expr2 "
Next v
'Loop ends; selected items are now accounted for...

'NOTE: To better understand what the code is doing, uncomment the
'next line to print the Where string to the Immediate window.
'Debug.Print WhereCrit

'Clean-up the Where string by removing the trailing text.
WhereCrit = Left(WhereCrit, Len(WhereCrit) - 17)

'Test (see note a few lines above).
'Debug.Print WhereCrit

'By default, the Suppliers Report returns all records from the Suppliers Table.
'Here the Suppliers Report is opened using the 'Where clause' to filter it down
'to only the items selected in the listbox.
DoCmd.OpenReport "MD Form", acViewPreview, , WhereCrit

End Sub
 

Users who are viewing this thread

Back
Top Bottom