Prompt before login

S

Sean

In my database I have 3 login accounts, I need a prompt to show users which
category they fall into prior to their logging in, can this be done with
simple VB code?
 
R

Rick B

Not sure what you mean. What is a "category"? How would Access know? If
John logs in every day, why would you want to remind him of his "category"
each time he logged in?

In any case, it can't be done BEFORE they log in, since no code executes
until after the login.
 
O

Ofer

After the user login, when you check if the user exist then you can add the
following VBA

dim MyDB as databse
dim MyRec as recordset, CatStr as string
set MyDB=codedb()
set myrec=mydb.openrecordset("Select * from categoryTable Where user_id = "
& me.userid)
if not myrec.eof then
while not myrec.eof
CatStr = CatStr & "," & myrec!categoryField
myrec.movenext
wend
end if
if not isnull(CatStr ) and CatStr <>"" then
msgbox "the categories you have are: " & mid(CatStr ,2)
endif
 
Top