Populate form txtBox with current User & Date

I'm in need of the code or syntax to autopopulate txtBox1 with th
current time & date and txtBox2 with the current User in an excel form
This is necessary to record who made changes to the data and when i
was done. 

Any assistance would be greatly appreciated!

Canuc

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

0
11/25/2003 12:23:27 PM
excel.misc 78881 articles. 5 followers. Follow

1 Replies
427 Views

Similar Articles

[PageSpeed] 48

Canuck,

Try something like the following:

Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA"
_
    (ByVal lpBuffer As String, nSize As Long) As Long

Private Sub CommandButton1_Click()
    Dim UN As String
    Dim Res As Long
    Dim L As Long
    UN = String(255, " ")
    L = Len(UN)
    Res = GetUserName(UN, L)
    UN = Left(UN, L - 1)
    Me.TextBox1.Text = Format(Now, "hh:mm dd-mmm-yyyy")
    Me.TextBox2.Text = UN
End Sub


-- 
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com





"Canuck" <Canuck.xg8vm@excelforum-nospam.com> wrote in message
news:Canuck.xg8vm@excelforum-nospam.com...
>
> I'm in need of the code or syntax to autopopulate txtBox1 with the
> current time & date and txtBox2 with the current User in an excel form.
> This is necessary to record who made changes to the data and when it
> was done.
>
> Any assistance would be greatly appreciated!
>
> Canuck
>
>
> ------------------------------------------------
> ~~ Message posted from http://www.ExcelTip.com/
> ~~View and post usenet messages directly from http://www.ExcelForum.com/
>


0
chip1612 (31)
11/25/2003 12:33:10 PM
Reply:

Similar Artilces:

Form fields vs. document properties
I'm creating common templates for multiple dealers of the same product. For example, one dealer may open my "Client Guide" document and all he needs to do is update approximately 20 fields and he is done. I'm using the standard document properties fields for my company information, but there are 10+ more unique fields I need to do this for. I've been trying all night to use quick parts, building blocks, etc. to accomplish this but I am really struggling. I can use a fill-in field, but it prompts for the field every place I use it. I've enabled th...

OWA denying access to Users, not administrators
Monday morning following a reboot of our SBS2000 server, OWA began denying access to users. User will attempt to sign on at the OWA log in dialog box and OWA will blink and present them with the log in dialog box again. After the 3rd attempt, the user receives a webpage with only the words: Error: Access is Denied. However, for those in the Administrators group, logging on is no problem. If I make a user a member of Administrators, they too can log in to OWA. Users are logging in on a variety of machines from Windows to Mac. Server is SBS2000, fully patched. This occurred af...

date formulas #5
Please help! I have given an example of part of the spreadsheet i am creating to outline my queery: Report in / Reply due / 1 Sept 2005 / 1 Sept 05 4 Sept 2005 / 18 Sept 05 / 14 Jan 00 / etc, / etc, I have entered the following formula in the 'reply due' column: B1 = A1 + 14 which calculates the date two weeks after the date in the 'report in' column. When i drag the formula down so it applies the entire 'reply due' column the cells aut...

Sub Form
I have a main form and a subform each has a table. The problem I'm running into is when I get to the subform, and try to enter info into it nothing happens. Also if I click in the subform it'll work but it starts at the last field in the subform. I need it to go to the first field on the subform. How would I get it to do this? I was told something about the label from the subform that something has to be entered into this. Thanks > when I get to the subform, and try to enter info into it nothing happens. What do you mean? Are you saying that you cannot even enter data in y...

require cell completion in a form?
I have a very simple form in Excel. I'm not sure if it matters, but the machine I'm on uses Excel 2002, and most of the users are on Excel 2000. The first 2 questions on my form require that the user select from a list of names, and then select their relationship to that person. Then the users answer a series of questions about this person's job performance. I'm using data validation to manage the two drop-down lists - the names and the relationships. However, about a third of my users end up leaving one or both of these cells blank. I have a comment box set up as a remin...

Date Last Sold
Date last sold should be tracked in the item quantities file and the item master. This is a common query request (show me all items we haven't sold in the past two years). Having to go to the sales line item history makes for a slow, complicated solution. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click...

how to create escalation form
How do I create escalation form. Abe wrote: > How do I create escalation form. Since you're the only one here who knows what you're escalating, to whom, in what way and for what reason, you are the only one who can tell what the form should look like. In general, you should create a Word template: http://www.word.mvps.org/FAQs/Customization/CreateATemplatePart1.htm If the form needs to have text that doesn't change, and places to enter text that does change, then you should create it as a form template: http://www.word.mvps.org/FAQs/TblsFldsFms/LinesInForms.h...

Date formatting in Excel #2
How do I format a cell to return Oct 04 when I type 10-4 in Excel...When I type 10-4, Excel returns Oct 05. Hi When no year is typed, excel would assume it is the current year. You would ahve to type the full date (including 2004) for it to display as Oct 2004. Use Format - cells - date and then select the particular format you want from the options there. >-----Original Message----- >How do I format a cell to return Oct 04 when I type 10-4 in Excel...When I >type 10-4, Excel returns Oct 05. >. > ...

Entourage: Calendar User Name Incorrect-Correct elsewhere.
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Email Client: Exchange Hi There, <br><br>It appears that whenever office was installed, the users name was misspelled. Now when he goes to setup a meeting, his own user name is misspelled. I've verified his own contact is set as default for himself. I've also deleted the office.pd and rerun the setup assistant and verified his name. <br><br>Is there a way to change that name? <br><br>Jaime On 2010-03-10 15:01:16 -0500, jaime_sf@officeformac.com said: > Hi Th...

Creating Forms
I want to create a form on my website but do not know which program to use. Should using html be adequate for the purpose? On 26 Mar 2007 10:16:47 -0700, stromo wrote: > I want to create a form on my website but do not know which program to > use. Should using html be adequate for the purpose? You have posted this message to the wrong newsgroup. The access in this groups name refers to Microsoft Access, a database program. Please repost to the correct newsgroup for whatever Office program you are using. I would suggest you include your Windows and Office version number in the message...

0xC0150010: The activation context being deactivated is not active for the current thread of execution.
I am seeing this error when exiting an exe built with C++ and Visual Studio 2005: Unhandled exception at 0x7c943345 (ntdll.dll) in 13F7254E.dmp: 0xC0150010: The activation context being deactivated is not active for the current thread of execution. > ntdll.dll!_RtlDeactivateActivationContextUnsafeFast@4() + 0x4214b bytes USER32.dll!_UserCallWinProcCheckWow@32() + 0xfb bytes USER32.dll!__local_unwind2() + 0x5f bytes ntdll.dll!ExecuteHandler2@20() + 0x26 bytes USER32.dll!_DispatchMessageWorker@8() + 0xdc bytes USER32.dll!_DispatchMessageW@4() + 0xf bytes MFC8...

Importing vcalendar data to multiple users
I'm running Exchange 5.5. Several times a year I have to create a large group of users. I'd like to be able to pre-populate each user's calendar with pertinent calendar events. Is there a way to import this type of data in batch mode? See if http://www.slipstick.com/calendar/holidays.htm#company helps. ME wrote: > I'm running Exchange 5.5. Several times a year I have to create a > large group of users. I'd like to be able to pre-populate each user's > calendar with pertinent calendar events. > > Is there a way to import this type of data in batch...

passing dates in a conditional sum(if)
I have a workbook with 5 sheets. Sheet1 is Customers Sheet2 is YTD Sales 07 Sheet3 is Total Sales 06 Sheet4 is Total Sales 05 Sheet5 is Total Sales 04 Customer sheet has this basic formula in the columns for each year's sales based on the customer's number and the variable of the month that the sales was done. {=SUM(IF((Custnumber07=A3)*(Month07<=$J$1),amount07))} The problem is that the accounting program exports the invoices with the MMDDYY for each invoice. The $j$1 is the number of the month I limit it up to. I have a column in each sales sheet with the month() function to...

Opening a blank form
Hi guys, I created a form to consult data, the record source is a query that gather information from different tables, the problem is when I open the form it shows data already, I want a blank form when it opens, I already tried including DoCmd.GoToRecord , , acNewRecord in the open from event, but I get “You can go to the specified record”, if I go to the query I can’t modify the data or add a new record that is why the acNewRecord is not working. I’ll really appreciate any help Thanks Maracay wrote: >I created a form to consult data, the record source is a query ...

DPM 2007 : Failed to update end-user recovery permissions
I have DPM 2007 installed on Windows 2008 SP2 backing up a file server also running Win2k8 SP2 (able to backup other systems without issue) Everytime it runs a sync job it produces a warning which is instantly resolved saying that ================================================ Status: Active Computer: BE-FS-01.ad.domain Description: Failed to update end-user recovery permissions. The operation failed because of a protection agent failure. For more information, open DPM Administrator Console and review the alert details in the Monitoring task area. ======================...

User defined type not defined
I am trying to create a simple macro to insert some text into an OL 2007 message. When I run the macro, I am getting a compile error "User-defined type not defined." Can someone tell me what commands I need to insert or change? Thank you. This is my code. Sub Greetings() ' ' Greetings Macro ' Macro recorded 9/4/2009 by Bob ' Dim objDoc As Word.Document Dim objSel As Word.Selection On Error Resume Next ' get a Word.Selection from the open Outlook item Set objDoc = Application.ActiveInspector.WordEditor Set objSel = ...

How to populate a value list
I have a field that is a valuelist. I select the value from a list that I typed in. That is fine. But I need to have those value in the order of selection. Ex : I have in the list the value from a to z. I select f, m, a. I want them to show up in that oder. At best I would like to use the same thing as Access when we define a combobox, we have 2 lists : the available field and the selected fields with 4 buttons in the middle. Can that be done ? Thank you -- eric On Mon, 23 Nov 2009 10:10:01 -0800, ericb <eric@b.com> wrote: >I have a field that is a ...

Form/ subform link problems
My parent form holds information about a part and my subform holds ordering information for that part. Up to now I have linked the child to the parent via PartID : RecordID and Component Name : Component name. This is great as it shows the component name on the subform after it has been found on the parent form. The only problem with this is if the user changes the component name it does not keep the order information for the same item with the old name. I want to link purely on the partID : RecordID so that whatever else is changed the order information history still shows. When I do t...

How Can A User Get NDR from PostMaster With Our Setup?
Exc 2003 as smtp only - we are using a spam filtering company and have firewall set to only accept emails from them - they are our mx. This company also filters viruses, attachments, etc. A user is getting an NDR that appears to be from Postmaster@ourdomain. It's being returned because of an attachment violation (it's a PIF file). The email address is not her normal one, but one of a group (jobp). This email address is being spoofed but how can she get emails from our Postmaster? I don't understand that. Her system has not been breached, she has AV on her desktop (it's ...

how to make outlook available to other users on same xp computer
My wife and I have sperate log ons for windows XP Professional but I can not figure out how to make Outlook available to her -- Richard "Richard" <Richard@discussions.microsoft.com> wrote in message news:5D931A9D-1CC6-4175-82D3-47506CD642DC@microsoft.com... > My wife and I have sperate log ons for windows XP Professional but I can > not > figure out how to make Outlook available to her > -- > Richard Richard, First have your ISP assign her a username and password, then when she logs on, she can open Outlook and establish account -- Tools - E-mail accoun...

viewing or redirecting emails from a particular user on exchange
We have a person who we think is sending company information by email to our competitiors. I want to be able to view emails sent from this person without their knowledge. So i need to be able to create a BCC of the email and sent it to another address so that i can view it. We are running SBS 2003 and Exchange 2003. If anyone could provide any information that would be great. Message Journaling: http://support.microsoft.com/default.aspx?scid=kb;en-us;261173&Product=exch2k On Thu, 16 Dec 2004 14:45:02 -0800, "fesz" <fesz@discussions.microsoft.com> wrote: >We...

how to get rid of default dates in Excel?
I want my dates to stay as I have typed them - not for them to be changed for the Excel default system. Then you must format the cells to your date entry style. Either before or after. BTW............Excel does not control default date format. That is controlled by your Windows Regional and Language settings. Gord Dibben MS Excel MVP On Mon, 22 Mar 2010 07:51:01 -0700, Margaret L. B. <Margaret L. B.@discussions.microsoft.com> wrote: >I want my dates to stay as I have typed them - not for them to be changed >for the Excel default system. 2 optio...

Get data from sheet to form and back to a different sheet
Hello, I'm new to VBA. I'm using VBA within Excel 2007. I am building a workbook to record customer contacts. The customers are listed on a sheet, the user scrolls around on the sheet and calls the form with <Shift><CTRL><C> when they find a customer they want to contact. The module for the macro starts out like this: ' Get the data from the spreadsheet to the form ContactForm.Company = Cells(ActiveCell.Row, 2) ContactForm.Contact = Cells(ActiveCell.Row, 4) ContactForm.Address = Cells(ActiveCell.Row, 5) ContactForm.City = C...

Excel 97/2000 - Autofilter
Hi, Im trying to find my perfect date using Excel (haha). I have all my friends in a database, with Autofilter on. Since I'm male, I first filter on the column sex=f, than second filter is on the column married=n. This works ok, all my non-married female friends are showing. Next I filter on salary=top 3 and the result is empty! I know that my non-married, female friends are not in the salary top-3 of my database, but that is not what I'm looking for. Im looking for the top-3 salary unmarried girls! What do I do wrong, this way I always stay single ! Regards, Ronald Ps. Yes I know, ...

Click And Fill Form Instant Get $3000
Click And Fill Form Instant Get $3000 At http://instantupdates.tk i have hidden the Form link in an image. in that website on Right Side below search box, click on image and enter your name and Address. ...