Using Wildcard with stDocName

davea300

Registered User.
Local time
Today, 22:14
Joined
Mar 16, 2007
Messages
164
I have a report that gets todays date appended to its name every time it is run. I call this report name in a section of code so I need to adjust the reports name everytime I call it.

Is it possible to define stDocName using a wildcard so it will take into account the change of report name each time, something like this:

stDocName = "ReportName*"

giving that "ReportName 25/08/2008" would be an example of the name.
 
Not that I am aware of. You could use something like ...

Code:
stDocName = "ReportName " & Date()

-dK
 
Use InStr function to see if something is in a string; you also have to loop through possible reports to find what matches and return an array of multiple choice.

See Access help for example on how to use InStr()

HTH.
 
You could use the Like operator

If "ReportName 25/08/2008" Like "ReportName*" Then
'code here
End If
 
Djkarl, funnily enough that was on my tongue, but I never did it in VBA and didn't have Access handy to check so played it safe with Instr(). Glad to know that it can be used in VBA, too. :)
 
I have a report that gets todays date appended to its name every time it is run.

Is it possible to define stDocName using a wildcard so it will take into account the change of report name each time ..

The confusing bit is you are asking two different things; wildcard is used for searches.

However per your example, you are looking to concatenate and come up with a unique name. All these responses will help no matter what is is you are really looking for.

-dK
 
The confusing bit is you are asking two different things; wildcard is used for searches.

Thanks, however I wasn't asking two different things. I already knew how to come up with a unique report name for each time it runs.

I have a report that gets todays date appended to its name every time it is run.

This line was intended as a statement. I was only asking how to call this unique name in code. Anyway I have it now so thanks to everyone.

However per your example, you are looking to concatenate and come up with a unique name. All these responses will help no matter what is is you are really looking for.

-dK
 

Users who are viewing this thread

Back
Top Bottom