currentproject.name as field

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

Hi,

How can i get the name of my database for use as a value in a query in sql
server. I would like a piece of the filename to be used as value.
I know currentproject.name gives me e.g. <variable name>_<currentdate>.mdb.
in an access query. So i need everything before the "_" as value.
 
Your best bet is to pass the field as a parameter into a function that does
the comparison and returns True or False.


Function dbName(strName As String) As Boolean

If strName = CurrentProject.Name Then
dbName = True
Else
dbName = False
End If

End Function

If you want the bit before the "_", you'll have to do some string
manipulation. If you post the format of the filename I'm sure people can
advise.
 
Back
Top