Run time error 94 - Invalid use of Null

hunter101

New member
Local time
Today, 00:05
Joined
Jun 16, 2008
Messages
2
Hi,

I am new to Access DB , my role is more of network supporting. I have this in house access DB. I was assigned to edit some records in the DB. while I changed some records and now when I try to generate email it is giving me this error. when I click debug it opens the editor with cursor at the line - strReportName = Me![cboSelectReport1]

The DB is about systems outages and generate email reports for sending to manager. the code is as follows:
=================================
Option Compare Database
Option Explicit

Dim strRecordSource As String
Dim strRecordSource1 As String
Dim strFieldName As String
Dim strSQL As String
Dim strReportName As String
Dim strValueList As String


Private Sub cmdPrint_Click()
Dim strFilter As String
Dim rpt As Report
Dim strInfo As String
Dim strInput As String


'strInput = InputBox("Enter Your First and Last Name")
'Username = strInput

DoCmd.SetWarnings False
DoCmd.OpenQuery "del_emailing", acNormal, acEdit
DoCmd.OpenQuery "EmailApp", acNormal, acEdit
DoCmd.OpenQuery "EmailInf", acNormal, acEdit
DoCmd.OpenQuery "Emailext", acNormal, acEdit

strReportName = Me![cboSelectReport1]

strFieldName = Me![cboSelectField]
strFilter = "[" & strFieldName & "] " & strValueList

strInfo = "Filtered by " & strFilter
Debug.Print "Filter: " & strFilter
DoCmd.OpenReport strReportName, acViewPreview
Set rpt = Reports(strReportName)
rpt.OrderByOn = True
rpt.OrderBy = strFieldName
rpt.FilterOn = True
rpt.Filter = strFilter


cmdPrint_ClickExit:
Exit Sub

cmdPrint_ClickError:
MsgBox "Error No: " & Err.Number & "; Description: " & Err.Description
Resume cmdPrint_ClickExit

End Sub

====================================

I will really appreciate help.
Thanks.

Hunter.
 
Simple Software Solutions

You need to select an item from the combo box before you decide to run the report.
 
Yes, I am selecting an item line and then clicking to generate an email. It does seems to run intially and then it ends up with the error.

Hunter.
 
Simple Software Solutions

Put a breakpoint on the offending line and F8 through it to check the problem.

Ie. Does the name of the report actually exist (typo)

David
 

Users who are viewing this thread

Back
Top Bottom