bad calling convention

jasn_78

Registered User.
Local time
Tomorrow, 07:00
Joined
Aug 1, 2001
Messages
214
when i run the following code i am getting a bad DLL calling convention can anyone help cause it was working now its not :(

Code:
    Call Report_filters(strrpt, Datewhere, dateto, datefrom, opt)

Public Sub Report_filters(strrpt As String, Datewhere As String, _
                            dateto As String, datefrom As String, rpttype As Integer)
Dim stwhere As String
Dim today As String


stwhere = ""
today = Format(Now(), "ddmmyy")

dateto = Format(dateto, "mm/dd/yyyy")
datefrom = Format(datefrom, "mm/dd/yyyy")

stwhere = stwhere & Datewhere & " Between #" & datefrom & "# And #" & dateto & "#"

Select Case rpttype
    Case Is = 1
        DoCmd.OpenReport strrpt, acViewPreview, , WhereCondition:=stwhere
        DoCmd.RunCommand acCmdZoom100
        DoCmd.Maximize
    Case Is = 3
'        Reports!rptACCOUNTRX.Filter = stwhere
'        Reports!rptACCOUNTRX.FilterOn = True
         DoCmd.OutputTo acOutputReport, strrpt, acFormatPDF, "C:\TFRS REPORTS\" & strrpt & today & ".PDF"
'        Reports!rptACCOUNTRX.FilterOn = False
End Select

thanks
Jason
 
nevermind guys figured it out
stupid filters lol
 
pat thanks but i tried that and it isnt formmating it into mm/dd/yyyy which is how the database i am accessing is stored in mm/dd/yyyy format whereas most users are used to dd/mm/yyyy format so thanks for the info but do u know how i can still send my date fields to the database in the right format??
 
Thanks pat i think i am starting to get how dates work in access the problem is the database i am accessing for reports is an interbase database and i think what is happening is when i get the user entering the date as dd/mm/yyyy and the interbase db is storing its dates as mm/dd/yyyy it doesnt want to filter correctly. ie its filters 12th of may 2008 (12/05/2008) as december 5th which isnt too helpful for me :)
 
Pat i did try that but using the date as a date variable unformatted but it still causes the same problems with month vs day and my windows default is set to dd/mm/yyyy

Thanks for your help and time and patience on this but i think i might just have to stay with the current solution atm :(
 

Users who are viewing this thread

Back
Top Bottom