desperately seeking syntax

Don't shoot me....

I made an error in the code that I provided (that's what I get for trying to work at the same time....lol)

Code:
Dim defectNo As String 

    If Cancel = True Then 
        GoTo StandardExit 
    Else 
        SQL = "SELECT defect_Ref, Asset_ID, Mtce_code " & _ 
              "FROM asset_defects " & _ 
              "WHERE asset_defects.defect_Ref Like '" & Nz(Form_AM_asset_maint_form_EMS.txtDefectNo & "*", "*") & "'" 

        Me.RecordSource = SQL 

    End If

I forgot that if you use the LIKE operator you MUST have the quotes. It's been awhile since I've done this and no longer have the original code that I wrote a couple years ago. I'm doing this from memory :(
 
Hi Ray

Somebody drop a MOAB on my head!

Ray you're a legend. That pesky null value error has gone, however the only problem that remains is that the report creates a new page for each record returned. I've got a 15 page report!

Is there a property somewhere that I might have inadvertently set?

Any ideas?

Cheers

Luigi
 

Users who are viewing this thread

Back
Top Bottom