A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

User Name in a text box



 
 
Thread Tools Display Modes
  #1  
Old May 25th, 2010, 05:40 PM posted to microsoft.public.access.forms
PJ
external usenet poster
 
Posts: 265
Default User Name in a text box

I have the following code in a memo text field:

Private Sub txtNotesOnTransaction_BeforeUpdate(Cancel As Integer)
Debug.Print "User: " & CurrentUser() & " " & Me!txtNotesOnTransaction
End Sub

I want the current user entering data user name to fill in before typing any
other data.

It is not working any suggestions?

Thanks!!
Ads
  #2  
Old May 25th, 2010, 05:55 PM posted to microsoft.public.access.forms
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default User Name in a text box

What does "not working:" mean in this context?

Are you getting an error? If so, what's the error? If you're not getting an
error, what are you getting (and what do you want to get instead)?

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
(no e-mails, please!)

"PJ" wrote in message
...
I have the following code in a memo text field:

Private Sub txtNotesOnTransaction_BeforeUpdate(Cancel As Integer)
Debug.Print "User: " & CurrentUser() & " " & Me!txtNotesOnTransaction
End Sub

I want the current user entering data user name to fill in before typing
any
other data.

It is not working any suggestions?

Thanks!!



  #3  
Old May 25th, 2010, 06:03 PM posted to microsoft.public.access.forms
Daryl S[_2_]
external usenet poster
 
Posts: 881
Default User Name in a text box

PJ -

Use the On Enter method instead of the On Update method, and put in code
like this:

If isnull(Me!txtNotesOnTransaction) Then
Me!txtNotesOnTransaction = CurrentUser()
End If

--
Daryl S


"PJ" wrote:

I have the following code in a memo text field:

Private Sub txtNotesOnTransaction_BeforeUpdate(Cancel As Integer)
Debug.Print "User: " & CurrentUser() & " " & Me!txtNotesOnTransaction
End Sub

I want the current user entering data user name to fill in before typing any
other data.

It is not working any suggestions?

Thanks!!

  #4  
Old May 25th, 2010, 06:41 PM posted to microsoft.public.access.forms
PJ
external usenet poster
 
Posts: 265
Default User Name in a text box

Thank Daryl, It worked can a date be added after the user name? If so, how
would that look.

Thanks again!!

"Daryl S" wrote:

PJ -

Use the On Enter method instead of the On Update method, and put in code
like this:

If isnull(Me!txtNotesOnTransaction) Then
Me!txtNotesOnTransaction = CurrentUser()
End If

--
Daryl S


"PJ" wrote:

I have the following code in a memo text field:

Private Sub txtNotesOnTransaction_BeforeUpdate(Cancel As Integer)
Debug.Print "User: " & CurrentUser() & " " & Me!txtNotesOnTransaction
End Sub

I want the current user entering data user name to fill in before typing any
other data.

It is not working any suggestions?

Thanks!!

  #5  
Old May 25th, 2010, 07:04 PM posted to microsoft.public.access.forms
PieterLinden via AccessMonster.com
external usenet poster
 
Posts: 307
Default User Name in a text box

PJ wrote:
Thank Daryl, It worked can a date be added after the user name? If so, how
would that look.

Thanks again!!

PJ -

[quoted text clipped - 17 lines]

Thanks!!

If isnull(Me!txtNotesOnTransaction) Then
Me!txtNotesOnTransaction = CurrentUser() & " " & Now()
End If

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201005/1

  #6  
Old May 27th, 2010, 10:42 PM posted to microsoft.public.access.forms
Daryl S[_2_]
external usenet poster
 
Posts: 881
Default User Name in a text box

PJ -

If you want the date and time, do as Pieter indicated - add this: & " " &
Now()

If you just want the date, add this: & " " & Date()

--
Daryl S


"PJ" wrote:

Thank Daryl, It worked can a date be added after the user name? If so, how
would that look.

Thanks again!!

"Daryl S" wrote:

PJ -

Use the On Enter method instead of the On Update method, and put in code
like this:

If isnull(Me!txtNotesOnTransaction) Then
Me!txtNotesOnTransaction = CurrentUser()
End If

--
Daryl S


"PJ" wrote:

I have the following code in a memo text field:

Private Sub txtNotesOnTransaction_BeforeUpdate(Cancel As Integer)
Debug.Print "User: " & CurrentUser() & " " & Me!txtNotesOnTransaction
End Sub

I want the current user entering data user name to fill in before typing any
other data.

It is not working any suggestions?

Thanks!!

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:06 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright 2004-2017 OfficeFrustration.
The comments are property of their posters.