Button invisible if User_Type is User

D

deb

I need a couple of tweeks to my splash form...

1. I would like to display the FullName of the user logged in on the
Splashform. The Fullname and the login ID is listed in the table
(tblVersion).

2. There is a button that should not be visible if the user logged in has
the User_type of "User" and should be visible if the User_Type is Admin. The
button is called "btnAdmin" .

How can I accomplish this? I need this desperately!!

I have a table (tblVersion) with the following fields:

UserID, FullName, and User_Type
mousm, Mickey Mouse, Admin
bman, Clark Kent, User
spman, Spider Man, User
 
L

Lance

make the button invisible during design time.. then in the form load event do
a check to see if the user is an admin, if they are set the button visible to
true.

If you give a few details on how your users log in and the setup of your
roles table.. and we can probably throw the code together to do that for you
pretty quickly.
 
D

deb

It uses Environ("username") to collect username and verify against the
tblVersion (see below)
I have a table (tblVersion) with the following fields:
How can I use Environ("username") to check against tblVersion to see if
User_Type is User and make button invisible?

Thanks in advance
 
L

Lance

if DLookup("[User_Type]", "[tblVersion]", "[UserID] = '" &
Environ("username") & "'") then
me.btnAdmin.visible = true
else
me.btnAdmin.visible = false
end if

You can also use the same basic approach to display your user name:
me("name_display_control") = DLookup("[FullName]", "[tblVersion]", "[UserID]
= '" & Environ("username") & "'")
 
D

deb

Thank you for your help!!!

I am putting the code in the onload of the splash form and I get a type
mismatch error


If DLookup("[User_Type]", "[tblVersion]", "[UserID] = '" &
Environ("username") & "'") Then
Me.btnAdmin.Visible = True
Else
Me.btnAdmin.Visible = False
End If
--
deb


Lance said:
if DLookup("[User_Type]", "[tblVersion]", "[UserID] = '" &
Environ("username") & "'") then
me.btnAdmin.visible = true
else
me.btnAdmin.visible = false
end if

You can also use the same basic approach to display your user name:
me("name_display_control") = DLookup("[FullName]", "[tblVersion]", "[UserID]
= '" & Environ("username") & "'")

deb said:
Yes they are the same.
 
D

deb

How does it know to be visible if user_Type is "Admin" and invisible if
User_Type is "User". I don't see Admin or User in the code.
--
deb


deb said:
Thank you for your help!!!

I am putting the code in the onload of the splash form and I get a type
mismatch error


If DLookup("[User_Type]", "[tblVersion]", "[UserID] = '" &
Environ("username") & "'") Then
Me.btnAdmin.Visible = True
Else
Me.btnAdmin.Visible = False
End If
--
deb


Lance said:
if DLookup("[User_Type]", "[tblVersion]", "[UserID] = '" &
Environ("username") & "'") then
me.btnAdmin.visible = true
else
me.btnAdmin.visible = false
end if

You can also use the same basic approach to display your user name:
me("name_display_control") = DLookup("[FullName]", "[tblVersion]", "[UserID]
= '" & Environ("username") & "'")

deb said:
Yes they are the same.

--
deb


:

Is the UserID entry for a user the same as their environment username?

:

It uses Environ("username") to collect username and verify against the
tblVersion (see below)
I have a table (tblVersion) with the following fields:

UserID, FullName, and User_Type
mousm, Mickey Mouse, Admin
bman, Clark Kent, User
spman, Spider Man, User

How can I use Environ("username") to check against tblVersion to see if
User_Type is User and make button invisible?

Thanks in advance



--
deb


:

make the button invisible during design time.. then in the form load event do
a check to see if the user is an admin, if they are set the button visible to
true.

If you give a few details on how your users log in and the setup of your
roles table.. and we can probably throw the code together to do that for you
pretty quickly.

:

I need a couple of tweeks to my splash form...

1. I would like to display the FullName of the user logged in on the
Splashform. The Fullname and the login ID is listed in the table
(tblVersion).

2. There is a button that should not be visible if the user logged in has
the User_type of "User" and should be visible if the User_Type is Admin. The
button is called "btnAdmin" .

How can I accomplish this? I need this desperately!!

I have a table (tblVersion) with the following fields:

UserID, FullName, and User_Type
mousm, Mickey Mouse, Admin
bman, Clark Kent, User
spman, Spider Man, User
 
L

Lance

Are you sure that your UserID field is a text field and not a numeric field?
Or.. is there an entry for your username in the table? This code is pretty
rough, it won't handle missing names nicely. That's something that will have
to be dealt with, and could be your problem here.. although I would think it
should be some invalid use of null error.

deb said:
Thank you for your help!!!

I am putting the code in the onload of the splash form and I get a type
mismatch error


If DLookup("[User_Type]", "[tblVersion]", "[UserID] = '" &
Environ("username") & "'") Then
Me.btnAdmin.Visible = True
Else
Me.btnAdmin.Visible = False
End If
--
deb


Lance said:
if DLookup("[User_Type]", "[tblVersion]", "[UserID] = '" &
Environ("username") & "'") then
me.btnAdmin.visible = true
else
me.btnAdmin.visible = false
end if

You can also use the same basic approach to display your user name:
me("name_display_control") = DLookup("[FullName]", "[tblVersion]", "[UserID]
= '" & Environ("username") & "'")

deb said:
Yes they are the same.

--
deb


:

Is the UserID entry for a user the same as their environment username?

:

It uses Environ("username") to collect username and verify against the
tblVersion (see below)
I have a table (tblVersion) with the following fields:

UserID, FullName, and User_Type
mousm, Mickey Mouse, Admin
bman, Clark Kent, User
spman, Spider Man, User

How can I use Environ("username") to check against tblVersion to see if
User_Type is User and make button invisible?

Thanks in advance



--
deb


:

make the button invisible during design time.. then in the form load event do
a check to see if the user is an admin, if they are set the button visible to
true.

If you give a few details on how your users log in and the setup of your
roles table.. and we can probably throw the code together to do that for you
pretty quickly.

:

I need a couple of tweeks to my splash form...

1. I would like to display the FullName of the user logged in on the
Splashform. The Fullname and the login ID is listed in the table
(tblVersion).

2. There is a button that should not be visible if the user logged in has
the User_type of "User" and should be visible if the User_Type is Admin. The
button is called "btnAdmin" .

How can I accomplish this? I need this desperately!!

I have a table (tblVersion) with the following fields:

UserID, FullName, and User_Type
mousm, Mickey Mouse, Admin
bman, Clark Kent, User
spman, Spider Man, User
 
D

deb

UserID is text. No blanks in table.
How does it chedk to see if the User_Type is "Admin" or "User"

Should it have a code that says if user_Type is "Admin" button is visible?

Thanks for hanging in there for me!

--
deb


Lance said:
Are you sure that your UserID field is a text field and not a numeric field?
Or.. is there an entry for your username in the table? This code is pretty
rough, it won't handle missing names nicely. That's something that will have
to be dealt with, and could be your problem here.. although I would think it
should be some invalid use of null error.

deb said:
Thank you for your help!!!

I am putting the code in the onload of the splash form and I get a type
mismatch error


If DLookup("[User_Type]", "[tblVersion]", "[UserID] = '" &
Environ("username") & "'") Then
Me.btnAdmin.Visible = True
Else
Me.btnAdmin.Visible = False
End If
--
deb


Lance said:
if DLookup("[User_Type]", "[tblVersion]", "[UserID] = '" &
Environ("username") & "'") then
me.btnAdmin.visible = true
else
me.btnAdmin.visible = false
end if

You can also use the same basic approach to display your user name:
me("name_display_control") = DLookup("[FullName]", "[tblVersion]", "[UserID]
= '" & Environ("username") & "'")

:

Yes they are the same.

--
deb


:

Is the UserID entry for a user the same as their environment username?

:

It uses Environ("username") to collect username and verify against the
tblVersion (see below)
I have a table (tblVersion) with the following fields:

UserID, FullName, and User_Type
mousm, Mickey Mouse, Admin
bman, Clark Kent, User
spman, Spider Man, User

How can I use Environ("username") to check against tblVersion to see if
User_Type is User and make button invisible?

Thanks in advance



--
deb


:

make the button invisible during design time.. then in the form load event do
a check to see if the user is an admin, if they are set the button visible to
true.

If you give a few details on how your users log in and the setup of your
roles table.. and we can probably throw the code together to do that for you
pretty quickly.

:

I need a couple of tweeks to my splash form...

1. I would like to display the FullName of the user logged in on the
Splashform. The Fullname and the login ID is listed in the table
(tblVersion).

2. There is a button that should not be visible if the user logged in has
the User_type of "User" and should be visible if the User_Type is Admin. The
button is called "btnAdmin" .

How can I accomplish this? I need this desperately!!

I have a table (tblVersion) with the following fields:

UserID, FullName, and User_Type
mousm, Mickey Mouse, Admin
bman, Clark Kent, User
spman, Spider Man, User
 
L

Lance

Ooops.. forgot to re-add that when I was switching it around from my test
tables to yours. Sorry about that. Should be this...

If DLookup("[User_Type]", "[tblVersion]", "[UserID] = '" &
Environ("username") & "'") = "admin" Then
Me.btnAdmin.Visible = True
Else
Me.btnAdmin.Visible = False
End If

Did you have an entry for your ID in the tblversion table?


deb said:
UserID is text. No blanks in table.
How does it chedk to see if the User_Type is "Admin" or "User"

Should it have a code that says if user_Type is "Admin" button is visible?

Thanks for hanging in there for me!

--
deb


Lance said:
Are you sure that your UserID field is a text field and not a numeric field?
Or.. is there an entry for your username in the table? This code is pretty
rough, it won't handle missing names nicely. That's something that will have
to be dealt with, and could be your problem here.. although I would think it
should be some invalid use of null error.

deb said:
Thank you for your help!!!

I am putting the code in the onload of the splash form and I get a type
mismatch error


If DLookup("[User_Type]", "[tblVersion]", "[UserID] = '" &
Environ("username") & "'") Then
Me.btnAdmin.Visible = True
Else
Me.btnAdmin.Visible = False
End If
--
deb


:

if DLookup("[User_Type]", "[tblVersion]", "[UserID] = '" &
Environ("username") & "'") then
me.btnAdmin.visible = true
else
me.btnAdmin.visible = false
end if

You can also use the same basic approach to display your user name:
me("name_display_control") = DLookup("[FullName]", "[tblVersion]", "[UserID]
= '" & Environ("username") & "'")

:

Yes they are the same.

--
deb


:

Is the UserID entry for a user the same as their environment username?

:

It uses Environ("username") to collect username and verify against the
tblVersion (see below)
I have a table (tblVersion) with the following fields:

UserID, FullName, and User_Type
mousm, Mickey Mouse, Admin
bman, Clark Kent, User
spman, Spider Man, User

How can I use Environ("username") to check against tblVersion to see if
User_Type is User and make button invisible?

Thanks in advance



--
deb


:

make the button invisible during design time.. then in the form load event do
a check to see if the user is an admin, if they are set the button visible to
true.

If you give a few details on how your users log in and the setup of your
roles table.. and we can probably throw the code together to do that for you
pretty quickly.

:

I need a couple of tweeks to my splash form...

1. I would like to display the FullName of the user logged in on the
Splashform. The Fullname and the login ID is listed in the table
(tblVersion).

2. There is a button that should not be visible if the user logged in has
the User_type of "User" and should be visible if the User_Type is Admin. The
button is called "btnAdmin" .

How can I accomplish this? I need this desperately!!

I have a table (tblVersion) with the following fields:

UserID, FullName, and User_Type
mousm, Mickey Mouse, Admin
bman, Clark Kent, User
spman, Spider Man, User
 
D

deb

This works perfectly!!! Thank you.


--
deb


Lance said:
Ooops.. forgot to re-add that when I was switching it around from my test
tables to yours. Sorry about that. Should be this...

If DLookup("[User_Type]", "[tblVersion]", "[UserID] = '" &
Environ("username") & "'") = "admin" Then
Me.btnAdmin.Visible = True
Else
Me.btnAdmin.Visible = False
End If

Did you have an entry for your ID in the tblversion table?


deb said:
UserID is text. No blanks in table.
How does it chedk to see if the User_Type is "Admin" or "User"

Should it have a code that says if user_Type is "Admin" button is visible?

Thanks for hanging in there for me!

--
deb


Lance said:
Are you sure that your UserID field is a text field and not a numeric field?
Or.. is there an entry for your username in the table? This code is pretty
rough, it won't handle missing names nicely. That's something that will have
to be dealt with, and could be your problem here.. although I would think it
should be some invalid use of null error.

:

Thank you for your help!!!

I am putting the code in the onload of the splash form and I get a type
mismatch error


If DLookup("[User_Type]", "[tblVersion]", "[UserID] = '" &
Environ("username") & "'") Then
Me.btnAdmin.Visible = True
Else
Me.btnAdmin.Visible = False
End If
--
deb


:

if DLookup("[User_Type]", "[tblVersion]", "[UserID] = '" &
Environ("username") & "'") then
me.btnAdmin.visible = true
else
me.btnAdmin.visible = false
end if

You can also use the same basic approach to display your user name:
me("name_display_control") = DLookup("[FullName]", "[tblVersion]", "[UserID]
= '" & Environ("username") & "'")

:

Yes they are the same.

--
deb


:

Is the UserID entry for a user the same as their environment username?

:

It uses Environ("username") to collect username and verify against the
tblVersion (see below)
I have a table (tblVersion) with the following fields:

UserID, FullName, and User_Type
mousm, Mickey Mouse, Admin
bman, Clark Kent, User
spman, Spider Man, User

How can I use Environ("username") to check against tblVersion to see if
User_Type is User and make button invisible?

Thanks in advance



--
deb


:

make the button invisible during design time.. then in the form load event do
a check to see if the user is an admin, if they are set the button visible to
true.

If you give a few details on how your users log in and the setup of your
roles table.. and we can probably throw the code together to do that for you
pretty quickly.

:

I need a couple of tweeks to my splash form...

1. I would like to display the FullName of the user logged in on the
Splashform. The Fullname and the login ID is listed in the table
(tblVersion).

2. There is a button that should not be visible if the user logged in has
the User_type of "User" and should be visible if the User_Type is Admin. The
button is called "btnAdmin" .

How can I accomplish this? I need this desperately!!

I have a table (tblVersion) with the following fields:

UserID, FullName, and User_Type
mousm, Mickey Mouse, Admin
bman, Clark Kent, User
spman, Spider Man, User
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top