Can I use a module property the same as I use a function in an SQL statement?

@MajP - Makese sense.

A quick aside to wrap this up....

I see in the WHERE portion two criteria. The username field and the active field. Is there a reason why one uses the fieldname directly (UserName=) and the other references the table again (tblUsers.Active=)?
 
Bearing in mind its based on my code, I'd better answer that....
There is no reason why tblUsers is needed before the Active field in the WHERE clause. It can be removed.

I also agree with creating a sql string so it can easily be debugged before execution
Using Dim strSQL As String would be better...otherwise its a variant

However, it isn't necessary to include the quotes around the function in the SET clause, though they are essential in the WHERE clause.
IIRC, using them in the SET clause will make the query less efficient i.e. slower, but I would need to test whether I have remembered that correctly.

The ( ) brackets can also be omitted
 
Last edited:

Users who are viewing this thread

Back
Top Bottom