Let me just start by saying how important it is to post your question carefully. I get that you, as a new user, may be unfamiliar with how to use the site well, including the [CODE] tags, nevertheless, if your post looks a mess and people trip over words that shouldn't be there they are likely to ignore your question and move on to one where the poster put the effort in to read that it at least makes good sense.
I've done what I can to tidy it up for you, but I couldn't make any sense of your first two sentences.
MNesom:
I have a report named jobrpt.
It has several reports and ...
I don't see how a report can have several reports. It doesn't sound like a report with several subreports. That would make sense but wouldn't fit the rest of the question.
However, I may be able to help with your SQL & VBA code. Let's see what we have.
Well, it turns out what I can say at this point is very limited due to the lack of reliable information in your question. At this point I can say that if you want to select something from the ComboBox and use that to filter your report then there are two important points to bear in mind :
- You generally filter using the WhereCriteria paramater, which is fourth in the list.
You're better off using named parameters to avoid just such confusion as found here, but failing that an extra comma (,) is required.
Don't be confused by the FilterName parameter. That's more complicated and requires a special filtering query. - Numeric, string & Date type values require different handling in SQL (Which is where the format of the WhereCriteria parameter comes from). In this case you seem to be trying to compare the ComboBox result with itself, so that won't work any time, but when you get the field you actually need to use sorted out then it should follow one of the formats below :
- "[NumericField]=X"
- "[DateField]=#X#"
- "[StringField]='X'"
For more details see
Literal DateTimes and Their Delimiters (#) and other articles linked therein.