Just a double quote at the beginning and end, nothing more required.
Double check that you didn't somehow overwrite the macro you think should be
running with the code from some other macro.
Of course, the UserIDs need to be in quotes as well.
And answering the question you had at the end, you only have two options for
startup:
- Have a macro named AutoExec
- Designate a start up form
You could have the AutoExec macro call the function, or you can have a
hidden form that calls the function in its Load event.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> It certainly does run, it just doesn't run properly. Its not running the
> correct macro. Are there any weird rules about Strings in VB? Null
[quoted text clipped - 30 lines]
>> > loads
>> > the function in a macro?
Yeah how do you start-up with a hidden form though? the form itself is
hidden, its set to load hidden, but startup loads it up visible.
-- I'd forgotten to put the id's in quotes, designating them as strings.
I'm surprised VB didn't ask me why i hadn't declared each of those userid's
as a variable name. It's been so long since i've really USED vb, i know it
lets you declare lots of things on the fly. I'm guessing it doesn't care
about variable declaration?
> Just a double quote at the beginning and end, nothing more required.
>
[quoted text clipped - 46 lines]
> >> > loads
> >> > the function in a macro?
PJFry - 30 May 2008 20:51 GMT
Using the form that opens on start-up with the OnLoad event:
DoCmd.OpenForm "Your Hidden Form", , , , , acHidden
> Yeah how do you start-up with a hidden form though? the form itself is
> hidden, its set to load hidden, but startup loads it up visible.
[quoted text clipped - 55 lines]
> > >> > loads
> > >> > the function in a macro?
Douglas J. Steele - 30 May 2008 21:09 GMT
> -- I'd forgotten to put the id's in quotes, designating them as strings.
> I'm surprised VB didn't ask me why i hadn't declared each of those
[quoted text clipped - 3 lines]
> lets you declare lots of things on the fly. I'm guessing it doesn't care
> about variable declaration?
That indicates that you haven't told VBA to require that all variables be
declared. Without that, VBA assumed that the names were variables
(specifically, Variant variables initialized to a value of Null)
Go into the VB Editor and select Tools | Options from the menu. On the
Editor tab, ensure that the "Require Variable Declaration" is checked. That
will add a line "Option Explicit" to the top of all modules from now on.
Unfortunately, you'll have to go into all your existing modules and add that
line.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)