Can't update records with CurrentUser() control

I have a form which is used to input customer data.  The same form
also has a button whose  OnClick event causes the form to be
repopulated using a query that prompts for the desired customer last
name...to look up specific customer records.  So far, so good.  I
recently was asked to monitor who (what users) input or update which
records.  So I created two additional fields in the customer records
UpdatedBy, and UpdateTime.  I use the BeforeUpdate event of the form
to assign the user and time to those two controls on the form

Private Sub Form_BeforeUpdate(Cancel As Integer)

    UpdatedBy = CurrentUser()
    UpdateTime = Now()

End Sub

This seems to work fine, also....However when I click the button to
look up the same record that was just created with the form, first of
all the controls on the form don't display the user or time
information that was saved in the record,...and worst of all when I
edit, or change the customer data, such as updat his phone number, and
try to save the record I get a Run-time error that says "You can't
assign a value to this object"  when I hit the 'debug' button the
UpdatedBy = CurrentUser() is highlighted.

0
charles
5/19/2007 9:29:02 PM
access 16762 articles. 3 followers. Follow

3 Replies
725 Views

Similar Articles

[PageSpeed] 36

>when I click the button to look up the same record that was just created with the form, first of
>all the controls on the form don't display the user or time information that was saved in the record...

Are you still on the record in question when you click the button to look up
the same record again? If so, the record hasn't been saved yet. Me.Dirty =
False will save the data.

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

Answers/posts based on Access 2000

Message posted via http://www.accessmonster.com

0
missinglinq
5/19/2007 10:44:53 PM
I follow the logic of both contributers to my post, and I guess I
should have mentioned that I do close the form after inputting the
data, and I also opened the customer table in table mode to verify
that the new data, including the UpdatedBy, and UpdateTime has been
written successfully to the table.  I then re-open the form before
clicking the 'search by name' button.


On May 19, 3:44 pm, "missinglinq via AccessMonster.com" <u28780@uwe>
wrote:
> >when I click the button to look up the same record that was just created with the form, first of
> >all the controls on the form don't display the user or time information that was saved in the record...
>
> Are you still on the record in question when you click the button to look up
> the same record again? If so, the record hasn't been saved yet. Me.Dirty =
> False will save the data.
>
> --
> There's ALWAYS more than one way to skin a cat!
>
> Answers/posts based on Access 2000
>
> Message posted viahttp://www.accessmonster.com


0
charles
5/19/2007 11:18:04 PM
Hi Charles,

If the data is in your table, then your problem is related to the display 
controls where you should see the information (updatedby and time).  Make 
sure the control source of the controls that are suppose to display the data 
are properly set to the fields in your table or query.  If the controls that 
are suppose to display that information (updatedby and time) are NOT in the 
main form, make sure that the form they're in has IT'S record source properly 
set.

Other than that, I'm not sure what to tell you.

Good Luck,
CW

"charles.kendricks@charter.net" wrote:

> I follow the logic of both contributers to my post, and I guess I
> should have mentioned that I do close the form after inputting the
> data, and I also opened the customer table in table mode to verify
> that the new data, including the UpdatedBy, and UpdateTime has been
> written successfully to the table.  I then re-open the form before
> clicking the 'search by name' button.
> 
> 
> On May 19, 3:44 pm, "missinglinq via AccessMonster.com" <u28780@uwe>
> wrote:
> > >when I click the button to look up the same record that was just created with the form, first of
> > >all the controls on the form don't display the user or time information that was saved in the record...
> >
> > Are you still on the record in question when you click the button to look up
> > the same record again? If so, the record hasn't been saved yet. Me.Dirty =
> > False will save the data.
> >
> > --
> > There's ALWAYS more than one way to skin a cat!
> >
> > Answers/posts based on Access 2000
> >
> > Message posted viahttp://www.accessmonster.com
> 
> 
> 
0
Utf
5/20/2007 12:24:00 AM
Reply:

Similar Artilces:

updating sheets based on data in first sheet
Another payroll question, I have a workbook that contains 26 sheets, one for each bi-weekl payroll period. I would like to set it up so when i add a new employe the rest of the sheets also update automatically with that employee name and information. I have been able to acheive this to a limited degree using th =sheet1!a1 formula, but this only updates the info in the first cel and particularly the first column. I would like to acheive this using the first sheet, since at th end of the year I would like to be able to calculate ytd figure easily. Thank -- Message posted from http://www.Exc...

Update for MS Money 2005?
I have Money 2005. Is there an update to MS Money for Canadian users? Thanks in advance for any answers. We need a bit more information! Are you having problems with M2005 or is this just a post-Christmas/New Year random query when you are trying to get away from the in-laws? -- Regards Bob Peel, Microsoft MVP - Money For unofficial FAQs see http://money.mvps.org/ or http://umpmfaq.info/ I do not respond to any emails that I have not specifically asked for. "Daniel" <Daniel@discussions.microsoft.com> wrote in message news:E86EAB89-21DE-4505-ACAD-647278D736BD@microso...

Problem with Script Updating
I am using a script to update the “1099 Type” field for Master Vendor table. The script basically is a basic if-then statement. This script is run “Before Document Commit” and it’s not updating correctly, its flip-flopping the results. When the script is set to run Before Document Commit I have the “Destination mapping” field “1099 Type” set to “Use Script”. Script below: If SourceFields("Send 1099") = "N" Then DestinationFields("Options.1099 Type").Value = 1 Else DestinationFields("Options.1099 Type").Value = 4 End If I have also tried this s...

Microsoft Update only updates Windows Defender
iacrosoft Update only updates Windows Defender - I have to use Belarc Advisor to get a list of missing updates, and then go to the Microsoft Download Center to search for the missing updates and download and install them one at a time. I have Windows XP Home SP3, with Microsoft Update set to automatic download - can anyone tell me why I do not get all the necessary upadtes? Is this a sudden, new problem? When was Automatic Updates last working? Can you update manually via http://windowsupdate.microsoft.com? Any chance you've got a beta build of WinXP SP3 installed? What...

Publisher 2007 and Microsoft Updates
I created a newsletter yesterday - everything fine - use Publisher all the time. Then an automatic update came down this morning and I can't open the file - it says "Publisher cannot open file" Other documents in Publisher are opening - any ideas? http://support.microsoft.com/kb/972566/ -- JoAnn Paules MVP Microsoft [Publisher] Tech Editor for "Microsoft Publisher 2007 For Dummies" "Kim" <Kim@discussions.microsoft.com> wrote in message news:8754339B-99DC-4D09-83AD-6B34D8215274@microsoft.com... >I created a newsletter yesterday - everythin...

Update question
Soory if this is the wrong place to ask this, but cannot find a NG proper to Windows 7. I currently run Windows Vista and am getting tired of Vista's decision to tell me that it is going to shut down in less than a minute. So have decided to upgrade to Windows &. I note that I can purchase an upgrade versiom for 64 quid from Amazon or an apparently full version of Windows 7 Home premium for 89 quid. My question is this - If I buy the upgrade version will I only be able to load it on a new PC in the future if I already have windows Vista installed? i.e For any future cl...

Outlook 2003 died mysteriously after update
Setup in a nutshell... System: Lenovo T500 laptop OS: Vista Business SP1 32-bit Software: Office Outlook 2003 SP3 Problem... So I'm using this setup for over a year, everything OK. Yesterday I did two things and now Outlook dies (quietly, sans error message) immediately after startup. It show the splash screen, displays my inbox, and *poof* disappears. What I did earlier... 1. Windows Update installed: KB9766662, KB979306, KB979099, KB975929 2. At the same time, while searching for another program to uninstall I stumbled upon (and uninstalled) Windows LIVE Toolbar and...

How update entity in post update?
I created a handler for Update post callout for Opportunity. I want update some fields of the opportunity on the PostUpdate. However, if I call the Update method of CRMOpportunity in the PostUpdate I will create a recursive post callout. Can somebody help me? Thank you for pay attention []'s Vin�cius Pitta Lima de Ara�jo You need to check the OrigObjectXML field to see what fields were updated and then act appropriately. Matt Parks MVP - Microsoft CRM ---------------------------------------- ---------------------------------------- On Wed, 4 Aug 2004 17:43:17 -0300, "Vin�cius ...

Cannot install update KB979906 for .NET Framework 1.1 SP1
Running : Windows XP media center edition SP3 Have tried installing KB979906 a few times and also downloaded update manually but cannot install this update. Receiving error 0x643.Is it safe to uninstall the .NET Framework 1.1 and re-install as possibly corrupt , without having to uninstall/re-install all other .NET frameworks 2 , 3 and 3.5 including the updates that go with them? .. Hello sherlockomes, you might want to look at the following kb article to see if this will help with the error 80070643. <http://windows.microsoft.com/en-US/windows-vista/Windows-Update-error...

Events to "Trap" Incomplete Record Creation?
I have the following scenario that's causing a problem: (1) Joe CluelessUser is adding a new record to a database through a form. (2) He fills in some fields, then gets distracted by something else, with the form and the incomplete (still missing some required fields) new record on his screen. (3) Quitting time rolls around, and Joe C has never completed his new record. He logs off and goes home, and his new record goes into byte heaven because of the missing required data. (4) Two weeks later, Joe C goes looking for his record, finds it ain't there, and beats me up because my d...

Print record once, update Yes/No field verifiying print
I would like to print a group of records, then have a Yes/No field [Printed] updated in my Jobs table with an update query showing the records were printed. Then next time the report runs, In my query criteria I will test for True values on the Yes/No field. Then only the records with the Yes/No field marked No will print. Any suggestions? Thanks Tommyboy,there's more to this question than meets the eye. For an explanation of what's involved, see: Has the record been printed? at: http://allenbrowne.com/ser-72.html The article includes a free sample database that dem...

latest update too MSCFV2
Hi, I have MSCFV2 version 6.5.7825.0. Could someone inform me if this is the latest download? Looks like you have 6.5.7825.0 from 05/21/2006, but there is a newer version - 6.5.7831.0 from 06/01/2006. C. Smith Enso Technologies, Incorporated http://www.ensotech.com On Tue, 13 Jun 2006 04:25:02 -0700, Paul <Paul@discussions.microsoft.com> wrote: >Hi, > >I have MSCFV2 version 6.5.7825.0. Could someone inform me if this is the >latest download? Christopher Smith csmith@ensotech.com Enso Technologies, Incorporated http://www.ensotech.com Also - meant to post this in t...

Dynamic Menu update
Hi All, I need to update a menu item dynamically, setting its SetCheck property to either true or false, based on a user operation. I am trying to do this from a custom function. Usually, the pCmdUI pointer is used. But how do I do it from another function? Thanks Your "other function" should change some setting. In your ON_UPDATE_COMMAND_UI handler, you should check that setting and call SetCheck as needed. -------------- Ajay Kalra ajaykalra@yahoo.com In addition to Ajay's response, this page may help you: http://msdn2.microsoft.com/en-us/library/6kc4d8f...

Changing the ip address on a domain controller runing exchange 2003
Hi, I have 3 DC in my organization and two of them are running Exchange 2003 back-end servers and the third one is Exchange 2003 front-end server. I want to change our company's ip address plan and acording to the article: http://searchwinsystems.techtarget.com/tip/1,289483,sid68_gci924473,00.html Is there anything in exchange configuration that i have to change except the smart host for the SMTP connector. Thanks in advance Hi, You will need to change your firewall to forward SMTP and OWA to the new IP but apart from that it should just work. Leif <Blade77@gmail.com> wrote in ...

picture control-frame type?
hello, I am inserting a picture control in my dialog box.i want to show a bitmap in the picture control.If i select the type of picture control as Bitmap then bitmap is displayed but there is some problem of sizing like after executuing the left area of control besides bitmap remains white. But what i want to ask is that when i put the picture type as frame the normal LoadBitmap and SetBitmap functions dont work? why?It seems i have to create a device context and use BitBlt function? please explain this type "frame" in picture control? That because the picture control as act...

online updates for money2003(not updating)
Money gets its updates from spcomstock.com and the server has moved to a new site. The default site that money provides has to be changed. At this time I don't know how to do this. If I find out how to do this I will Post it. ...

Payroll Update
HI all, We are running GP 7.5. I installed SP7 and the July 2005 tax update for CDN payroll. Now out payroll administrator gets an error message: 'The modified version of P_Payroll registry is missing'. How do I fix this problem Thanks -- Henry ...

Static Control Curiosity
I noticed that if one gives a static control a unique ID, it will offer a BN_CLICKED event. It doesn't, however, respond. The MESSAGE_MAP does have what appears to be an appropriate entry. How, if at all, can one bring this control to life? Motivation: though almost all other functionality is gone, this would be an easy way to color a "button". Balboos "Balboos" <balboos@masonicbrother.com.No.Spam> wrote in message news:%Sffc.40827$467.10202411@news4.srv.hcvlny.cv.net... > I noticed that if one gives a static control a unique ID, it will offer > a ...

Cycle through some controls and unlock
I have a form that contains contains over 100 controls (divided into tabs). The locked default is "Yes". Is there some way I can flag certain controls so that I can cycle through them with an "Edit" button and unlock them? There are about 50 that will need to be unlocked and I'd rather not have 50 lines in VB for Me.Controlname.Locked = False if there is another way. Perhaps check to see if it is a tab stop and if so, unlock it? I have the code to cycle through ALL controls to lock them. Any help would be appreciated. Thanks! You could use the Tag property of e...

[ANN] Excel X security update
Hi All, A security update for Excel X was also released today: http://www.microsoft.com/mac/downloads.aspx?pid=download&location=/mac/d ownload/officex/ExcelX_Security_1017.xml&secid=5&ssid=17&flgnosysreq=Tru e Or at least: http://www.microsoft.com/mac/downloads.aspx Corentin -- --- Mac:MS MVP (Francophone) --- http://www.mvps.org - http://mvp.support.microsoft.com MVPs are not MS employees - Les MVP ne travaillent pas pour MS Remove "NoSpam" to e-mail me - Retirez "NoSpam" pour m'�crire ...

HOW ABOUT AN UPDATE?
Microsoft, can we get an update on the login issue please???? It's been a whole day since we heard from Russ last. Err, Russ sent 2 updates today. Subject line = "File Lock Update" Hope you can find them. "shan" <anonymous@discussions.microsoft.com> wrote in message news:6bef01c475b3$3e7d6ea0$a601280a@phx.gbl... > Microsoft, can we get an update on the login issue > please???? It's been a whole day since we heard from > Russ last. >-----Original Message----- Look again, he posted 2 yesterday, we are still waiting for something today...

FWD: Try on these correction update from the MS Corp.
--omvflfmgecbtuznop Content-Type: multipart/related; boundary="pesxyyfvxtk"; type="multipart/alternative" --pesxyyfvxtk Content-Type: multipart/alternative; boundary="locjfxspwlfruwcg" --locjfxspwlfruwcg Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Microsoft Client this is the latest version of security update, the "October 2003, Cumulative Patch" update which fixes all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express. Install now to continue keeping your computer secure from th...

Returning top 5 records of a large table
I have a very large table called Service: CREATE TABLE [Service] (ServiceID int, ClientID int, TimeIn datetime) I want to return the last 5 records entered in the table. Basically: SELECT TOP 5 ServiceID, ClientID, TimeIn FROM [Service] ORDER BY TimeIn DESC But this is very inefficient with high IO. The problem is ServiceID is not necessarily contiguous and I don't know the date range of the last 5 services, so I don't have a good candidate for a WHERE clause. Any ideas how to improve this query? Thanks, Dave David, An index on TimeIn would hel...

Cannot Update office
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: intel When I try to update office a message appears saying that a version of the software needed to udate microsoft office is not available. What is this and what can be done to correct it I have the same problem with Tiger 10.4.11. "efrosini@officeformac.com" wrote: > Version: 2008 > Operating System: Mac OS X 10.5 (Leopard) > Processor: intel > > When I try to update office a message appears saying that a version of the software needed to udate microsoft office is not available. What is this and ...

Cannot update table--only does SQL insert
Hi, just another newbie type of question.... i have a new window with its own table. i'm doing a "copy from window to table" &c, and it works fine to insert data the first time. however, i can tell from the SQL Profiler that when I try to modify the data, it does not do an update--it tries to do another insert (and of course, can't). Is there something I should be setting in Dexterity somewhere to make the table updatable, or do I need to manage this with PassThroughSQL? thanks in advance. Table operations are covered in detail during the Dexterity Training, pl...