Can't get the report button working right.

mystery45

Registered User.
Local time
Today, 11:22
Joined
Mar 31, 2008
Messages
14
Hi all you guys have been a great help in the past. The DB admin at work is swamped right now however here it goes.

I have a form that all it does is allow the user to search the database for a processing date and generates a report for that processing day.

It is setup so that there are 2 fields. a start and end for processing.

Private Sub Report_Click()
If (Me.End_CDC) = "" Then
DoCmd.OpenReport "Game_Report", acViewPreview, , "CDC_Date = " & CInt(Me.Start_CDC)
Else
DoCmd.OpenReport "Game_Report", acViewPreview, , ("CDC_Date BETWEEN ") & (CInt([Start_CDC])) & “ And “ & (CInt([End_CDC]))
End If
End Sub

this is the code i have on the button.

however if i stick 1 number in the start field i get an invalid use of null error.

if i stick 2 numbers in it i get a type mismatch. i have it set to convert it to integer since that is what is on the main form.

DoCmd.OpenReport "Game_Report", acViewPreview, , "CDC_Date = " & Me.CDC_Date

this is the code i have on another button on the main page and it works just fine. however it only pulls up 1 report and the current one you can't search or get a range of reports.
 

Users who are viewing this thread

Back
Top Bottom