Data Driven Event?

D

Douglas J. Steele

What do you mean by username: their Windows Network ID, or have you applied
User Level Security (ULS) and you mean their Access user name?

For Windows Network ID, the function in
http://www.mvps.org/access/api/api0008.htm at "The Access Web" will return
their id. You can then use something like:

DoCmd.OpenForm "NameOfForm", acNormal, , "[UserId] = '" & fOSUserName() &
"'"

For ULS, the CurrentUser function returns their user name, so you'd use

DoCmd.OpenForm "NameOfForm", acNormal, , "[UserId] = '" & CurrentUser() &
"'"

(both solutions assume, of course, that you've stored a UserId on each
record so that you know to whom each record applies)
 
G

Gator

Username that a Client would establish via their account information in DB
--
Gator


Douglas J. Steele said:
What do you mean by username: their Windows Network ID, or have you applied
User Level Security (ULS) and you mean their Access user name?

For Windows Network ID, the function in
http://www.mvps.org/access/api/api0008.htm at "The Access Web" will return
their id. You can then use something like:

DoCmd.OpenForm "NameOfForm", acNormal, , "[UserId] = '" & fOSUserName() &
"'"

For ULS, the CurrentUser function returns their user name, so you'd use

DoCmd.OpenForm "NameOfForm", acNormal, , "[UserId] = '" & CurrentUser() &
"'"

(both solutions assume, of course, that you've stored a UserId on each
record so that you know to whom each record applies)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Gator said:
How do I open a Form with only the user's information displayed based on a
username
 
T

Tom Ventouris

I am looking for something similar:

Some way to get the machine name and then run code using select case.
Different code from different machines.

I plan to place an unbound text box on the hidden form which maintains the
link between the FE and BE. What I need is some way to get the machine name
in the unbound box and use this in the code.

Any help on this one?

Douglas J. Steele said:
What do you mean by username: their Windows Network ID, or have you applied
User Level Security (ULS) and you mean their Access user name?

For Windows Network ID, the function in
http://www.mvps.org/access/api/api0008.htm at "The Access Web" will return
their id. You can then use something like:

DoCmd.OpenForm "NameOfForm", acNormal, , "[UserId] = '" & fOSUserName() &
"'"

For ULS, the CurrentUser function returns their user name, so you'd use

DoCmd.OpenForm "NameOfForm", acNormal, , "[UserId] = '" & CurrentUser() &
"'"

(both solutions assume, of course, that you've stored a UserId on each
record so that you know to whom each record applies)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Gator said:
How do I open a Form with only the user's information displayed based on a
username
 
T

Tom Ventouris

Please ignore this question. The machine name is to accesible. I am getting
the job done with the C: seriel number.

Tom Ventouris said:
I am looking for something similar:

Some way to get the machine name and then run code using select case.
Different code from different machines.

I plan to place an unbound text box on the hidden form which maintains the
link between the FE and BE. What I need is some way to get the machine name
in the unbound box and use this in the code.

Any help on this one?

Douglas J. Steele said:
What do you mean by username: their Windows Network ID, or have you applied
User Level Security (ULS) and you mean their Access user name?

For Windows Network ID, the function in
http://www.mvps.org/access/api/api0008.htm at "The Access Web" will return
their id. You can then use something like:

DoCmd.OpenForm "NameOfForm", acNormal, , "[UserId] = '" & fOSUserName() &
"'"

For ULS, the CurrentUser function returns their user name, so you'd use

DoCmd.OpenForm "NameOfForm", acNormal, , "[UserId] = '" & CurrentUser() &
"'"

(both solutions assume, of course, that you've stored a UserId on each
record so that you know to whom each record applies)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Gator said:
How do I open a Form with only the user's information displayed based on a
username
 
D

Douglas J. Steele

The approach is the same: you need to create a criteria when opening the
form.

Note, of course, that it's not going to prevent others from seeing all of
the data if they so desire.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Gator said:
Username that a Client would establish via their account information in DB
--
Gator


Douglas J. Steele said:
What do you mean by username: their Windows Network ID, or have you
applied
User Level Security (ULS) and you mean their Access user name?

For Windows Network ID, the function in
http://www.mvps.org/access/api/api0008.htm at "The Access Web" will
return
their id. You can then use something like:

DoCmd.OpenForm "NameOfForm", acNormal, , "[UserId] = '" & fOSUserName() &
"'"

For ULS, the CurrentUser function returns their user name, so you'd use

DoCmd.OpenForm "NameOfForm", acNormal, , "[UserId] = '" & CurrentUser() &
"'"

(both solutions assume, of course, that you've stored a UserId on each
record so that you know to whom each record applies)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Gator said:
How do I open a Form with only the user's information displayed based
on a
username
 
Top