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  

Adding a Username to a Transaction from a Form



 
 
Thread Tools Display Modes
  #1  
Old August 30th, 2006, 11:48 PM posted to microsoft.public.access.forms
Rillo
external usenet poster
 
Posts: 24
Default Adding a Username to a Transaction from a Form

I have a continuous form called “Ledger Transactions to be deleted” that
displays one or more transactions for a given client.

The user can set a flag on a selected transaction to denote that the
transaction is to be marked for deletion.

I want the system to attach the name of the user to the transaction.

The username is a field on the transaction record and is on the “Ledger
Transactions to be deleted" form, but is not visible.

The username is recorded on a form called "Welcome Menu".

I assume I could use the Setvalue action to populate the username field on
Delete Transaction i.e. [Forms]![Ledger Transactions to be
deleted]![Username], [Forms]![Welcome Menu]![Username]

However, where should I put the Setvalue Action? I tried putting the
Setvalue Action
on the Gotfocus event on the Username field, but this does not seem to work.

Secondly I have a table called Username, which holds a single record
containing the username. This record is changed when the user enters his/her
name on the Welcome Menu.
I would prefer to add the username to the [Forms]![Ledger Transactions to be
deleted]![Username] field by accessing the Username table, rather than
leaving the Welcome Menu open. How could this be done?

--
Thanks in anticipation.
  #2  
Old August 31st, 2006, 04:00 AM posted to microsoft.public.access.forms
Arvin Meyer [MVP]
external usenet poster
 
Posts: 4,231
Default Adding a Username to a Transaction from a Form

Instead of closing the Welcome Menu, just hide it by setting the form's
visible property to false. A command button can be labeled to close, but
actually just hide the form. Code would be something like:

Sub cmdClose_Click()
Me.Visible = False
End Sub

Now you can simply refer to the textbox on the Welcome Menu:

Sub Form_AfterUpdate()
Me.txtUserName = Forms![Welcome Menu]!txtUserName
End Sub
--
Arvin Meyer, MCP, MVP
Free MS-Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Rillo" wrote in message
...
I have a continuous form called "Ledger Transactions to be deleted" that
displays one or more transactions for a given client.

The user can set a flag on a selected transaction to denote that the
transaction is to be marked for deletion.

I want the system to attach the name of the user to the transaction.

The username is a field on the transaction record and is on the "Ledger
Transactions to be deleted" form, but is not visible.

The username is recorded on a form called "Welcome Menu".

I assume I could use the Setvalue action to populate the username field on
Delete Transaction i.e. [Forms]![Ledger Transactions to be
deleted]![Username], [Forms]![Welcome Menu]![Username]

However, where should I put the Setvalue Action? I tried putting the
Setvalue Action
on the Gotfocus event on the Username field, but this does not seem to
work.

Secondly I have a table called Username, which holds a single record
containing the username. This record is changed when the user enters
his/her
name on the Welcome Menu.
I would prefer to add the username to the [Forms]![Ledger Transactions to
be
deleted]![Username] field by accessing the Username table, rather than
leaving the Welcome Menu open. How could this be done?

--
Thanks in anticipation.



 




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 10:04 PM.


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