AfterUpdate Now() to table

I am using:
CurrentDb.Execute "UPDATE tbl_Projects SET DateUpdated = Now()"
as suggested here, but it is updating ALL records, how do I specify the 
record that was actully changed?
0
Utf
1/16/2008 5:09:01 PM
access.formscoding 7493 articles. 0 followers. Follow

2 Replies
468 Views

Similar Articles

[PageSpeed] 48

If you are talking about TimeStamping a record that was updated on a form
then you want your code in the BeforeUpdate event of the form.  In this case
you do not need SQL but simply:
[DateUpdated] = Now

MeSteve wrote:
>I am using:
>CurrentDb.Execute "UPDATE tbl_Projects SET DateUpdated = Now()"
>as suggested here, but it is updating ALL records, how do I specify the 
>record that was actully changed?

-- 
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

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

0
ruralguy
1/16/2008 5:54:49 PM
CurrentDb.Execute "UPDATE tbl_Projects SET DateUpdated = Now() " & _
  "WHERE ID = " & Me.ID

(or whatever's necessary to uniquely identify the row)

-- 
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"MeSteve" <MeSteve@discussions.microsoft.com> wrote in message 
news:5AF15AB4-E1EE-442B-943B-597A3AC892F3@microsoft.com...
>I am using:
> CurrentDb.Execute "UPDATE tbl_Projects SET DateUpdated = Now()"
> as suggested here, but it is updating ALL records, how do I specify the
> record that was actully changed? 


0
Douglas
1/16/2008 5:56:31 PM
Reply:

Similar Artilces:

AfterUpdate/BeforeUpdate and SetFocus
I have some problems with the SetFocus command in a Userform with an AfterUpdate or BeforeUpdate routine. To make it clear to you, I made a very small Userform to demonstrate it. It only contains 8 TextBoxes and this code: Code: Private Sub TextBox01_AfterUpdate() Me.TextBox08.SetFocus End Sub - Private Sub TextBox02_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean) TextBox08.SetFocus End Sub - Private Sub TextBox03_Exit(ByVal Cancel As MSForms.ReturnBoolean) TextBox08.SetFocus End Sub - Private Sub TextBox04_Change() TextBox08.SetFocus End Sub I expected that in ...

Newsgroup statistics for December 2003 are now available
In keeping with the annual pattern, the number of posts in December dropped compared to previous months. The number of large posts dropped dramatically since March 2003, which is when I suspect MS stopped allowing people to attach files to posts made from its CDO web-to-NG portal. Interestingly enough, the number of multi-posts and cross-posts also seem to have dropped slightly in the last half of the year. Could it be because of the increasing popularity of web-to-NG portals? Writing about web-to-NG portals, three of the top four posting sources are such portals. Among individual p...

How do I put information into a NEW journal table?
Having created a New table in Outlook 2003 Journal with different column headings (to record family tree history), how can I put information into each of the new headings, which do not appear on the Journal Entry form? You'll need to create a custom fields for the new information. -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com/ Outlook Tips by email: mailto:dailytips-subscribe-request@lists.outlooktips.net EMO - a weekly newsletter about Outlook and Exchange: mailto:EMO-NEWS...

Insert from Table A to Table B with criteria
Hi, I need to create a schedule for teachers to proctor finals. I have 2 tables: Table A has the classrooms that need proctors and the times of the test. Table B has a list of teachers and the times that they work in the school. I need to write a program to fill Table A, using the teachers in Table B. But for each row in Table A, I need to check: 1) does the teacher work during the time period of the test, 2) are they already slated to proctor in a different room at that time. This isn't a difficult algorithm, I think. I just need to iterate through each row of Tab...

Question about Pivot Tables..why is that
WordXP I created the pivot table successfully and am up to dragging the field and putting them in the column. Why is it that sometimes I put the field in the column and it fills out the entire column with the info (ex. putting the "serial #" field in the column produces all the serial numbers to show up in each cell underneath) and other times I put the field in the column and all it shows is the sum amount. What is happening? Thank you. ~D~ There are four 'areas' in a pivot table , row fields, column fields, page fields and values. The value area is where the pivot ...

Hey Friends I have installed The Platform SDK now what changes are required in order to port the application created now #2
> Hey Friends I have installed The Platform SDK.I want to mknow that what > changes are required in order to port the application created now. > > is any change is required even if i use MFC as Statically Linked library. > > Are the changes OS Specific ? > > Is there any Setup Builder which encorporates the latest changes > > Pl Help me. > > > What do you mean by porting? If your application was compiling correctly before, you dont need platform SDK. PlatformSDK essentially enhances win32 SDK by providing APIs not found in Win32SDK. If you dont intend...

Custom settings now working
I am having problems with the custom security settings. I installed the security administrative package and followed Microsoft's documentation. However, I am still getting the Outlook notification whenever I try to use CDO. I am not an Outlook admin so I am having a rough time trying to debug this. What are some things I can look at to try to resolve this issue. I noticed that when I go to Outlook and go the Outlook 10 Security Settings under public folders I see the form under that folder. Is this correct? My set up is Exchange 2000, Outlook 2003. Have you checked to make sure th...

Files gone... now what?
Okay, this is an ODD problem... hopefully someone can help. To start with, I have Office XP with Frontpage, and Publisher 2002. Now, what happened is, I had them installed on a seperate drive from the boot drive. I decided to install a Linux distro on one of my other drives. Unfortuantly, during the installation, i picked hte one with all the progras on it... not the one i just emptied.. So, i messed up, and everything was deleted.... I figured no big deal, I'll reinstall. So, here is wherehte odd stuff starts. I tried to uninstall all of it from XP... no good, bhecasue the files are n...

Using pivot table without summing, etc.
Hello, I have data in the following format: Date SMBL Data 1 A 10 2 A 12 3 A 13 4 B 40 5 B 42 6 B 46 and I need to get it into the f...

pivot table rolling 12 month filter?
Is there a way to add a rolling 12 month date filter for 'last 12 months' to a pivot table? I see how to add conditional filters like last year, last month, etc., but I need a way to filter for 'last 12 months' (or even last 6) so that I don't have to update the date filter every month. This pivot table is for manufacturing production data and is connected to an analysis services data cube. I'm using excel 2007. Thanks for any help! Randy, I would think that you could form your query to only return 12 months of data - I don't use data cubes, s...

5.5 to 2K3 migration seemed to go well, but now...
I have a single Windows 2000 domain, and had Exchange 5.5 installed on a W2K member server. I needed to upgrade to Exchange 2003, and I also needed to change the Organization and Site name of the Exchange 5.5 installation. I installed a temporary W2K3 server, installed E2K3 on it, and used the Migration ustility to move all of the mailboxes over to the TEMP server. I also used the InterOrg replication utility to move the Public Folders (not the system folders) to the TEMP E2K3 server. I tested it, and everything seemed to make it over alright. I modified the permissions on the public folders ...

Pivot Table #46
Hello, I have pivot table based on data that identifies an item as "late" "late if not rec'd today" and "late if not shipped today". The totol lists the correct number from each category for a location but when I double click on that total I get a list of every entry for that location, not just the late etc. What am I doing wrong? When you double click on a total, does it generate a new worksheet? If yes, it is listing out all the data, which the total field is made up of. The other possibility is that you are unhiding a summary field. Govind. xgirl...

SSRS 2008 working with table of contents
I have the following questions about creating sql server 2008 reports: I am creating a report that will contain the following: a. page header with the title of the report, b. page footers that contain the page numbers, and c. table of contents to tie about 27 subreports together, d. several of the tables in the subreport will appear on more than one page. Thus, I would like to know how to tie all of this together. I am planning on doing the following: 1. Put the title of the report in a textbox control, 2. Somehow have logic in the tables to know to wrap to the next ...

How do I do a Depreciation Table
i really need help for my assignment and i dont know how to do a depreciation table its really simpl ei just cant do it the purchase price is $200 000 and it depreciate 5% each year and i haev ot work out the value oafter 25 years. i really need help so i know what im doing. thanks for any help Good Morning SarahJessica88 I assume from your question that you are using reducing balance depreciation (as opposed to straight line which would be fully depreciated at 5% after 20 years). I also assume you want to show the balance each year and not just the balance after 25 years. If you have...

AfterUpdate
Hello Chaps, In the AfterUpdate code I had the detail back colour change if a check box (tbc) = True. However if I tick the box now it turns the back colour of every form irrespective if that record is ticked tbc or not! Any help on solving this would be great. JAMES Private Sub tbc_afterupdate() If Me.tbc = True Then Me.Section(0).BackColor = 65535 Else Me.Section(0).BackColor = 16777215 End If End Sub If you are using a continuous form, that code won't work. The good news is that you can use Conditional Formatting to make it work. In Design View, select the combo box and fro...

how can I change the scale of the numbers in my chart data table?
I have set up a simple graph, and I have opted to show a data table at the bottom which shows my graph results numerically. However, whilst I have changed the scale on the value axis with no problem, I cannot change the scale of my data table to thousands.. the only option I seem to have is to be able to format the font. Please can you help? A chart data table has very limited capability. Instead of using one, consider simulating the effect. See Custom Chart Table http://www.tushar-mehta.com/excel/newsgroups/data_table/index.htm -- Regards, Tushar Mehta www.tushar-mehta.com Excel,...

reshap table
Hi I want to format a table. In the attached file you will find the sourc table and the desired format. I tryed to use Pivot Table but is no suited for the problem. Thank +---------------------------------------------------------------- | Attachment filename: problem.xls |Download attachment: http://www.excelforum.com/attachment.php?postid=361731 +---------------------------------------------------------------- ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly f...

AfterUpdate Question!
I want to add this to my code , Ony enter date if [DateCheck] (checkbox) is -1 Any help would be great..............Thanks Bob Private Sub tbAdditionCharge_AfterUpdate() If tbDayNo.value = "" Or IsNull(tbDayNo.value) Then tbDayNo.value = Format(Now, "dd-mmm-yy") End If End Sub Hi Bob, Me.tbDayNo=IIf(Me.DateCheck And IsNull(tbDayNo), _ Format(Date,"dd/mm/yy"),tbDayNo) Regards Jacob "Bob V" <rjvance@ihug.co.nz> wrote in message news:%23xApdzD7HHA.4880@TK2MSFTNGP03.phx.gbl... | | I want to add this to my code , Ony enter date if [D...

Outlook Burped and HTML Format Now Shows
Suddenly, HTML formatting is showing on my Outlook new mail messages composed with HTML. How can I delete this without having to resort to plain text emails? JTLaBelle wrote on Mon, 29 December 2008 10:56 > Suddenly, HTML formatting is showing on my Outlook new mail messages composed > with HTML. How can I delete this without having to resort to plain text > emails? Is it showing on messages you receive or messages you compose? If when you compose, does Alt+F9 hide it? If messages you receive, what version of outlook? version of windows? do you have all the latest updates i...

Now I wants to have me cake & eat it
Hi I am making an excel report from access using the following: DoCmd.TransferSpreadsheet acExport, _ acSpreadsheetTypeExcel9, "QUERY NAME", _ "C:\FILE LOCATION AND NAME - " & sToday & ".xls", True, "SHEET NAME" Is there any way I can format the cells in excel from here. I am thinking background colours, and number / date formats? Stapes ...

2000 Repair Now Outlook Is Dead (Connecting To Exchange Server)
I hope someone can help with this. Due to a crash I had to replace the motherboard on my PC. I am running Windows 2000 (SP4). I had to run the repair so it would start up but once it was complete everything came up accept my outlook. Everytime I try to fire it it tells me it can't access outlook.ost. I have uninstalled..re-installed..even went back to outlook 2000 but nothing works. How can I completely remove everything so that the system doesn't even know that office was installed. if that will even help. Procedures Tried: Uninstall ReInstall Repair Delete Profiles Delete ENTI...

Hurry Up Now, Free Check Of $327 With Your Name.
Hurry Up, Free Check Of $327 With Your Name. Quickly open below website and click any one of the Red Color Text in the website and enter your payeename and address where to get your check. The secret website link is http://googleadsense-highpaying-keywords.blogspot.com/ ...

Any way to default to "Send now" instead of "Edit before sending"?
When responding to a meeting request in Outlook 2007, is there a way to make it default to "Send the response now" instead of "Edit the response before sending"? RNW;118796 Wrote: > When responding to a meeting request in Outlook 2007, is there a way to > make > it default to "Send the response now" instead of "Edit the response > before > sending"? I don't believe it's possible to modify that. -- Brian Tillman [MVP-Outlook] http://forums.slipstick.com ...

Pivot Table Date Range
Hi I am using Win2000 and Excel 2000. I would like to know if there is a way of including a date range in a pivot table that allows me to select between 2 dates. That is, I would like to be able to type in a specific start date (ie; 01/01/05) and a specific end date (ie; 18/05/05) and have the pivot table extract the data. Is this possible? Any help will be much appreciated. Thanks John I like to do it this way: I insert another column in the raw data. I create a formula in that helper column: =if(and(a2>=date(2005,1,1),a2<=date(2005,5,5)),"show","Hide"...

W-2 State Wages Table
When printing the W-2 report, from what table does it pull the State Wages and Tips info? And, is that table something that can be altered? -- matt burton Send a message to me at callen@bkd.com and I'll send you a document that tells you where each field gets its data. You cannot alter the table structure but you can always alter the table data if you have access to a tool that can open the data behind the scenes. -- Charles Allen, MVP "Matt Burton" wrote: > When printing the W-2 report, from what table does it pull the State Wages > and Tips info? And, is t...