Load event question

I found this code along with it's function on this discussion group. It works 
great but I want it to populate the text field when the form loads.
How can I get the following code on the Form_Load()? 
fOSUserName() is a defined function.

Private Sub Form_BeforeUpdate(Cancel As Integer)
    On Error GoTo BeforeUpdate_Err

    ' Set bound controls to system date and time and current user name
    Me.DateModified = Now()
    Me.ModifiedBy = fOSUserName()

BeforeUpdate_End:
    Exit Sub
BeforeUpdate_Err:
    MsgBox Err.Description, vbCritical & vbOKOnly, _
        "Error Number " & Err.Number & " Occurred"
    Resume BeforeUpdate_End
End Sub

0
Utf
3/18/2010 6:58:16 PM
access.forms 6864 articles. 2 followers. Follow

6 Replies
977 Views

Similar Articles

[PageSpeed] 11

You should be able to just copy the same code into the On Load event.

Private Sub Form_Load()

    Me.DateModified = Now()
    Me.ModifiedBy = fOSUserName()

End Sub

0
ghetto_banjo
3/18/2010 7:56:55 PM
What is your point in placing it in the Load event?  This will only cause the
fields in the first record that loads to be changed, and what if that record
isn't actually modified?  It will now have erroneous information.

-- 
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/201003/1

0
Linq
3/18/2010 9:19:19 PM
The 'modifiedby' field is what I found on the forum, my field is actually 
called 'User' and I am using it to capture what user is entering data into 
the form. I want it to populate automatically when the user opens the form.

"Linq Adams via AccessMonster.com" wrote:

> What is your point in placing it in the Load event?  This will only cause the
> fields in the first record that loads to be changed, and what if that record
> isn't actually modified?  It will now have erroneous information.
> 
> -- 
> There's ALWAYS more than one way to skin a cat!
> 
> Answers/posts based on Access 2000/2003
> 
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/201003/1
> 
> .
> 
0
Utf
3/24/2010 3:19:03 PM
=?Utf-8?B?SWFnbw==?= <Iago@discussions.microsoft.com> wrote in
news:50FA36E3-2AA8-45ED-9B37-0E5068C56F8D@microsoft.com: 

> The 'modifiedby' field is what I found on the forum, my field is
> actually called 'User' and I am using it to capture what user is
> entering data into the form. I want it to populate automatically
> when the user opens the form. 
> 
I think you really would want it to save the user when the user 
actually updates the information in the form to the table. To do that 
use the Form's Before_Update Event. 

Using the Load event means that EVERY user will be shown as the USER 
in EVERY ROW that is looked at, as well as the ones that do get new 
data entered..

I'm sure that's not what you really want.

as to the different field name, just change me.ModifiedBy to me.User

Bob Q




> "Linq Adams via AccessMonster.com" wrote:
> 
>> What is your point in placing it in the Load event?  This will
>> only cause the fields in the first record that loads to be
>> changed, and what if that record isn't actually modified?  It
>> will now have erroneous information. 
>> 
>> -- 
>> There's ALWAYS more than one way to skin a cat!
>> 
>> Answers/posts based on Access 2000/2003
>> 
>> Message posted via AccessMonster.com
>> http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/201003/1
>> 
>> .
>> 
> 



-- 
Bob Quintal

PA is y I've altered my email address.
0
Bob
3/24/2010 9:51:20 PM
Bob Quintal wrote:
"Using the Load event means that EVERY user will be shown as the USER 
in EVERY ROW that is looked at, as well as the ones that do get new 
data entered."

Actually, placing this in the Form_Load event will only effect the first
record displayed, not every record!

-- 
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/201003/1

0
Linq
3/25/2010 1:38:35 PM
"Linq Adams via AccessMonster.com" <u28780@uwe> wrote in
news:a589aae4ce2b7@uwe: 

> Bob Quintal wrote:
> "Using the Load event means that EVERY user will be shown as the
> USER in EVERY ROW that is looked at, as well as the ones that do
> get new data entered."
> 
> Actually, placing this in the Form_Load event will only effect the
> first record displayed, not every record!
> 
If the load event places the data into an unbound box, and code in 
another event writes it to the table, it will affect every row. 

-- 
Bob Quintal

PA is y I've altered my email address.
0
Bob
3/25/2010 9:02:53 PM
Reply:

Similar Artilces:

Anual event notifications
One of our users tells us she is not getting reminders about annual events she has in a 'company calendar' public folder. Ex2003 SP1, O2003 SP2. The event is set up as a meeting. In the Appointment tab, the To: address is her own name. The event is shown as an all day event and the reminder is ticked at 18 hours. The scheduling tab shows she has herself as the meeting organizer and as a required attendee. I've used Exchange Message Tracking set one day early and one day later but can't see anything that could be a notification. Can I track these notifications? Is ...

Macro Question Again
I'v never had any dealings w/ macro before, so this is all new to me. I have a windows 98 computer that is running office 2000 and there is an excel macro on this pc that was created by someone years ago. I have to get this 98 machine of the network and replace it w/ a 2000/XP platform also running either office 2000/xp. So far i'v copied the macro and am able to run it, but its not gathering the correct info. It is collecting the correct info on the 98 machine, just not the one im replacing it w/. It looks like some of the fields are supposed to be populated w/ info in a text d...

Event ID 9554/Unable to Update Mailbox SD
I am continuing to get the event below; I referenced Microsoft KB 555433 in which it details how to use ADFind Utility to locate the mailbox in question and update the permissions -- however, there is no account in my domain that matches that GUID. Any ideas? Event Type: Warning Event Source: MSExchangeIS Event Category: General Event ID: 9554 Date: 10/6/2005 Time: 8:59:59 AM User: N/A Computer: MY EXCHANGE SERVER Description: Unable to update Mailbox SD in the DS. Mailbox Guid: fe3913d5-a4e0-4c0e-b3b1-291f50d7fc4f. Error Code 0x8004010f For more information, click http://www.microsoft.c...

Question on Returns to Vendor without PO & Receipt number
Our company switched to Great Plains Dynamics from Simply Accounting 3 months ago. We currently need to return some of the inventory items to our vendors. However, when we try to enter a transaction entry in Purchasing/Returns Transaction Entry, in the detail lines we are asked for the PO number or the receipt number. We are not allowed to go further or save without the PO number or receipt number. When we converted from Simply Accounting, all we entered was the beginning balance of the vendors and only the PO's which we expect to receive. The older PO's were not carried over. W...

Licensing Question with Professional Suite
Hey, I've seen some licensing questions out there, but wanted to be clear. Microsoft Reps are giving me different information, but admit they do not know!? I think there needs to be a little more training with the CRM licensing. I need the CRM Professional Suite (sales and service). If I have 5 sales people (that don't really need to get into the Service Stuff), and I have 5 Service People (that don't need to do anything with Leads and other stuff), can I purchase 5 Sales Professional Users and 5 Service Professional Users? Or do I still need to purchase the Suite User...

Questions about Migrating from Outlook Express to Outlook
I'm thinking about migrating from OE 6 to Outlook 2003 and was wondering if I will lose my folder structures, rules, and address book by doing so. I also use Yahoo POPs for importing my Yahoo e-mails into OE. Will I need to reconfigure the Yahoo POPs to work with Outlook after the migration? Thanks in advance for your help! Spudy Not sure about the YahooPOPs thing but using Outlook's File menu > Import & Export command should get most of the data. You can also try exporting from OE. "Spudy" <spudy@spamless.com> wrote in message news:th1hd1ddvnto8he4fsv9mluf...

IF question...
I need a formula which will allow me to accept a number if it falls within a certain range. For instance, I want the cell to recognize the number in the cell if it falls between 1 and 10. Otherwise, I want the cell to return a 0 value. Anybody? =IF(AND(A1>=1,A1<=10),what?,0) On Mon, 25 Oct 2004 19:15:06 -0700, "mailrail" <mailrail@discussions.microsoft.com> wrote: >I need a formula which will allow me to accept a number if it falls within a >certain range. For instance, I want the cell to recognize the number in the >cell if it falls between 1 and 10....

Outlook macro question
I have two email accounts in Outlook 2003. I know about the Accounts drop list in new emails. But is it possible to create a few macros so that I end up with two buttons where each runs a macro that starts a new email using a specific account? One button would start a new email using account 1 and the other button would start a new email using account 2. If so, could someone please give me some pointers? Thanks. Outlook doesn't provide any direct way to change the account for an = outgoing message in versions before Outlook 2003. See=20 http://www.outlookcode.com/codedetail.aspx?id=3D88...

xp outlook so slow to load
I just bought top of the line Dell with XP and Outlook takes 2 minutes to load! My 3-yr old laptop with same PST file took 10 seconds. Any ideas why? Try disabling the integration with Instant Messenger in Tools | Options | Other and see if that speeds things up. -- Jocelyn Fiorello MVP - Outlook *** Replies sent to my e-mail address will probably not be answered -- please reply only to the newsgroup to preserve the message thread. *** In news:00ab01c39d10$908bbb60$a001280a@phx.gbl, camgyrl wrote: > I just bought top of the line Dell with XP and Outlook > takes 2 minutes to lo...

Stack overflow question
Occassionally when on Facebookwith MSIE if I have 2 instance of Facebook open (Different pages) I will get an error message of "Stack Overflow at Line: 31". When I click OK the page finishes loading fine. Any suggestions as to what is going on? Running: <<< System Summary >>> > Manufacturer : eMachines Inc. > Mainboard : eMachines WMCP61M > Chipset : nVidia GeForce 6100V > Processor : AMD Athlon Neo MV 26 @ 1600 MHz > Physical Memory : 4096 MB (2 x 2048 DDR2-SDRAM ) > Video Card : NVIDIA GeForce 6150SE nForce 430 ...

Easy question on Excel...
Hello I have an Excel workbook open which has 5 worksheets. How do I toggle through them manually without using the mouse to click a sheet? I am sure I used to know how but now I forget! Regards Alex Try Ctrl + PageUp Ctrl + PageDown Regard -- Message posted from http://www.ExcelForum.com Well done. Thanks. >-----Original Message----- >Try > >Ctrl + PageUp > >Ctrl + PageDown > >Regards > > >--- >Message posted from http://www.ExcelForum.com/ > >. > Ctrl + Page Up or Page Dow -- Message posted from http://www.ExcelForum.com Hi I th...

Excel template and access questions
We are going to use the Excel purhase order templates. We need to save each order in order to refer back to it. Is there a way to do this without saving each individual file (order)? Can we save in some sort of easy to locate "batch"? Also, is there a way to transfer a template that we have done (and all the data realted to it) into a Acess database withouthaveing to so much tweaking? If you have Access, I would suggest creating your purchase order database in Access and then having a mail merge push this information into an Excel template as needed, rather than going the othe...

Button Control Event: question
I have a small dialog that prints data it queries from a server to a listbox when a user presses a start button. What I'd like to do is to have the data continually print after the button is pressed until the user presses a stop button. So, I guess I would need to initiate some kind of continuous loop for the data querying/printing, but I'm unsure how to get the stop button to break the loop. If this even the best solution. Does anyone have any ideas of how I could accomplish this, or perhaps a better design idea? Thanks, Marcus Marcus wrote: > I have a small dialog that prints d...

Word/Office Integration as seen at CRM 3.0 Partner Readiness Event
Has anyone seen available resources on integration to Office 2003 applications such as Word?? I saw this demo'd at a Partner Readiness event back in Nov. 2005 and they showed a very tight integration with Word for not only mail merge and easy template building (with CRM fields available), but also a task pane that allowed update/edit of existing CRM records within Word. This was being demo'd as "CRM 3.0 tightly integrated with Office"...Ok, so where is this resource? Also, does anyone know where I can find the supposed 100+ CRM web parts for SharePoint?? thanks, A...

Simple question about text within a cell
I can't seem to find the option that prevents text from covering the adjacent cell. For example if I type the folling in cell A1: All I want for Christmas is my two front teeth. Obviously that will overflow over the cell B1 (if there is no data in B1). I don't want to resize my column, I only want the cell to show as much text in A1 as possible without covering cell B1. I believe I've seen the option to do what I'm looking for but I can't seem to find it and I can't figure out how to look it up in the HELP file. Thanks in advance. Rick My simple solution ha...

Some stupid questions about edit the aspx file
Hi, I'm quite newbie about asp.net & other web application. I've heared that we can put some code in the CRM aspx file. For example, we can make OnChange event to the textbox in CRM & put some code in it. I know it is unsupported by microsoft, but I need to know how to do it. I've been searching this newsgroup & microsoft.public.crm, but I couldn't found any sample. My question is pretty simple (or stupid, I guess): I've looked in inetpub\wwwroot\SFA\quotes\edit.aspx, but I don't know what to do. My friend telling me that the code behind, is under som...

Windows Pro C.O.A. Question
I have a Dell Latitude D510 with Windows XP Pro SP2 installed. It's used and the machine didn't come with a restore disk, and there is no restore partition. But the COA sticker is attached to the bottom of the machine. I have an OEM copy of Windows XP Pro with SP2. If I have to reinstall the operating system, can I use the OEM version and use the laptop's COA to activate Windows? I realize that I may have to hunt down drivers such as WiFi and sound if they aren't included with my OEM copy. Thanks Don wrote: > I have a Dell Latitude D510 with Windows X...

Address Book renaming contacts. (2 questions)
For WHATEVER reason Outlook 2002 - XP is renaming my contacts in my address book.. so when I try and use autocomplete it doesn't work. (Type in "Sha" to get the choice between Shadow and Sha'mer and it just gives me Sha'mer) So - gritting my teeth - I go in and change the name of the contact BACK to Shadow and it STILL doesn't register in the autocomplete. 1) How the (ahem) do I get Outlook to stop renaming my contacts? 2) How do I get it to recognize names in the autocomplete? I now have about 7 that it doesn't, and it's a royal pain. Thanks for your tim...

Named Properties Error (Event ID: 9667)
Having problems with good old Event 9667. Thats the problem where Exchange 2003 stop accepting some emails when it hits the 16k soft limit on Named Properties. I've seen the KB article regarding adjusting the size of the named properties cache (if i can call it a cache) up to 32k but, as others have pointed out, that just delays the problem. I would like to know if anyone knows of any good ways to filter headers such that they are reduced to just the standard headers necessary for email delivery? Thanks, K ...

RMS User Question/Problem
Hello, I Downloaded and installed Microsoft Dynamics RMS, but when I first run it (for the first time) it asks me user ID and password, but have not yet established one, and is the first time I run the program! (Or is it comes with some standard user / default?) User ID: 1 Password: password Robert Armstrong RMS Systems Inc. "F.Misle" <F.Misle@discussions.microsoft.com> wrote in message news:B29A28E5-315C-4A1A-9490-A497651736A0@microsoft.com... > Hello, > I Downloaded and installed Microsoft Dynamics RMS, but when I first run it > (for the first...

Excel, Macro designed to send mails via Outlook : question on certificate
Hi everybody, I created in Excel a macro designed to send specific mails via Outlook. Because an Outlook dialog box asked me all the time whether I authorize the transmission or not, I created a certificate using MS Office "SelfCert". So far so good. My macro is signed. However, Outlook keeps on asking me everytime to authorize the transmission of the mails. What should I do / check ? Anybody ? Many thanks in adavance for your time and kind help. Daniel Everything you wanted to know about sending emails fro Excel using Outlook. http://www.rondebruin.nl/sendmail.htm Go...

EVENT ID: 51 & 26
Hi. I'm telecommuting today. I was working happily along when=20 all of a sudden, Windows 2000 Pro froze. Nothing worked,=20 no way to restart so I pushed the restart button. Now, when I try to open Outlook in my profile, the other=20 two on the pc are fine, I get two error messages that=20 basically happen simultaneously. EVENT ID: 51 Event Type: Warning Event Source: Disk Event Category: None Event ID: 51 Date: 6/30/2004 Time: 3:54:18 PM User: N/A Computer: THE-REED-RANCH Description: An error was detected on device \Device\Harddisk1\DR1=20 during a paging operation.=20 Data: 0000: ...

Slow load for Analysis Toolpak
I have a macro in a file that automatically loaded the Analysis Toolpak - VBA, but when I upgraded to Excel 2003, it takes FOREVER to load this add-in. Anyone know why or how to fix? No, but I don't think you need the macro. Just select Tools, Add-ins, Analysis toolpak and it should load every time. "RyanK" wrote: > I have a macro in a file that automatically loaded the Analysis Toolpak - VBA, but when I upgraded to Excel 2003, it takes FOREVER to load this add-in. Anyone know why or how to fix? ...

Hover buttons not loading quickly & Java Security Warning
Hi, I am pulling my hair out over this one! I'll be most grateful for any help. Here is the beginning of my new site: http://www.johnblaustein.com/web3/ You will notice that when the splash page transitions to the home.html page, the link images do not load immediately. I used FP2003's hover buttons for the links. The reason I want to use images instead of text for the links is so that the size of the links won't change if the user adjusts those browser settings. Can someone tell me why the buttons are loading so slowly? I suspect it is because the browse...

Newbie question
I have just started using Outlook, as it will talk to my phone whereas Palm Desktop won't, and I cannot find a way of displaying the day name as well as the date in Calendar's five and seven day views i.e., instead of the column heading displaying August 27, is there a way of making it display Friday August 27, as it does in Palm Desktop? I'm using Outlook 2002 (Office XP) build 10.2627.2625 with Win2kPro Thanks, DD Control Panel->Regional Settings, set your long day format to dddd. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion int...