Ok, I've been trying to figure this out for a few days and it just isn't working no matter what permutations I put it through. What I'm trying to do is open a report based on the record in the form (and only that one so that I can save it to a PDF individually instead of in one big congolmerate report). I created a button and put this code in the expression builder for the On Click event:
The error that I keep receiving (no matter how I adjust this) is: The expression you entered contains invalid syntax. You may have entered an operand without an operator. It gives me this error even when I take it down to just the report title. I cannot figure out (from searching online or in my books) how to adjust this.
I've tried making this just a simple Open Report button (by adding parenthesis around the report title) but that (when clicked) causes an error that Access failed to evaluate one or more expressions because "DoCmd" was referenced in an expression.
I need to get this figured out. Any help (as always) is gratefully received and fully appreciated.
Code:
= DoCmd.OpenReport "LossDamageRPT", acViewPreview,,"[CLAIMNUM] ='" & [CLAIMNUM] & "'"
The error that I keep receiving (no matter how I adjust this) is: The expression you entered contains invalid syntax. You may have entered an operand without an operator. It gives me this error even when I take it down to just the report title. I cannot figure out (from searching online or in my books) how to adjust this.
I've tried making this just a simple Open Report button (by adding parenthesis around the report title) but that (when clicked) causes an error that Access failed to evaluate one or more expressions because "DoCmd" was referenced in an expression.
I need to get this figured out. Any help (as always) is gratefully received and fully appreciated.