Just trying to play with some code to learn about collections and other apparently the LIKE NOT operator or whatever is supposed to be the equivalent of the NOT LIKE in a query.
I say "supposed" because at this point I don't know what the equivalent is because the results I get are ambiguous.
The below code is supposed to iterate through the tables in my database, which it does, IF I replace the statement:
If T.Name Like Not "msys*" Then etc..
with
If T.Name Like "msys*" Then etc.. (only returns all tables which start with msys)
The LIKE NOT operator gives an error: datatype mismatch, so...
I guess my question is, what is the appropriate syntax for NOT LIKE? LIKE NOT doesn't appear to be it. I get an error when using this. I can't find anything else in HELP or online for that matter.
Note, obviously I'm trying to exclude the Sys Tables from my results. There may be another way to do this, but I as I stated in the beginning, this is more an exersize in applying some principles.
Any help is appreciated..!
Dim db As DAO.Database
Dim strTblName As String
Dim T As TableDef
Dim msystbl As String
Set db = CurrentDb
For Each T In db.TableDefs
If T.Name Like Not "msys*" Then
strTblName = strTblName & vbCrLf & T.Name
End If
Next
MsgBox strTblName
End Sub