Hide User ID

D

Doug_C

Hello,

On my database, I have a comments field that when the update status button
is licked will automaically drop the Current Date and Time. If I wanted to
add the user ID to that, is there a way I could make the user ID invisible or
hide it from showing on the form? It's find if it shows in a table because
myself and the manager could open it. This particular database is like a
message board and was created with the intented for people in the department
to have some fun with. Just want to keep the ID hidden so people can freely
use it but in case someone gets out of hand, I will have it stored in the
table attached to their comment. If can be accomplished, please simplfy as I
am not up to speed with you folks but hope to be someday.

Thanks!!!
 
J

Joan Wild

Just add a textbox to the form and set its visible property to No, and
update it as you have the date and time.

If you have implemented Access Security you can get their userID via
CurrentUser(). If you haven't implemented security, then you can get their
windows login name using the following function...
http://www.mvps.org/access/api/api0008.htm
 
D

Doug_C

Hi Joan,

If I create another textbox, How do I get the information to enter? In
otherwords, If I connect it to fill off the comments box, it will fill with
the information. However, I need to remove the User ID from the Comments box
or somehow hide it in there. If I copy the code I used for the comments box
into the textbox, how am I going to get it to input without being connected
to anything?
 
J

Joan Wild

Let's back up a bit. You said when someone clicks a button you update the
current date/time. Please expand on what you are actually doing.

I picture a form with a comment field, and a 'update status' button. I
assumed that when they clicked this button you updated some field to the
current date/time by using =Now(). You'd just expand that by updating a
UserID with =fOSUserName() using the function I directed you to.

Can you explain what I misunderstand?
 
D

Doug_C

You are correct in everything. Except, I do not want the UserID to show on
the comments field. So what I am asking is, when a user clicks the Update
button which will automatically show the date and time and then input their
comments, how can I see who put that comment in their without them seeing? I
can add a UserID to the Now() but it shows in the comments box with everthing
else. Maybe I am not following what you are referring to. Again, I am quite
the novice at this so I kind of need this spelled out. This way it's easier
to follow and I can copy it down for further use so I can learn to do it
myself.

Thanks!!
 
J

Joan Wild

Maybe what you are doing is updating the actual comment field by adding
Now() to the end of the comment (i.e. in the same field?)

In the table where the comment is stored, add two fields MadeBy (text 15)
and TimeMade (date/time)

In your form you can place two textboxes on the form, one bound to the
MadeBy field, and on bound to the TimeMade field.

In the OnClick of your button put
Me!MadeBy = fOSUserName()
Me!TimeMade = Now()

You can make the textbox bound to MadeBy invisible (on the format tab of the
properties box)

Actually, you don't even need this button, if that's all it does. You can
set the default property of the textboxes to
=fOSUserName()
and
=Now()
and they will automatically be entered when the user creates a new comment.

Is that clearer?
 
D

Doug_C

Hi Joan,

Yes, it is much clearer. Also, you are correct, I am updating everything in
one field. I will follow you instruction and implement the code describe.
This looks like it will work much better and satisfy the demand. Thank you so
much for simplifying this for me, it makes it much easier to understand.

Have a great day!!

Doug
 
D

Doug_C

Hi Joan,

I made the text boxes and added the two fields to the table. When I enter
the code to the Default value of the text boxes, nothing happens when I click
the update status button. When I place the code for the onClick event in the
button, it stops on fOSUserName(). No sure if I did something wrong, the
instructions seemed pretty self explanatory. But I think bet it was a user
error. :eek:)

Thanks!
 
Top