Conditional updating - 98561

I have the following working updating function which is ok:

CurrentDb.Execute "UPDATE Products SET office = products.grossprice*0.72"

I want to add on a condition depending on the field “code” in the same table
products. But I do no know how to do it.I do not want to use a form but
otherwise is it possible to do it ?
What I want to achieve is the following:

If  Products.code = 10153 or Products.code = 10567 or Products.code =  324555
Then
CurrentDb.Execute "UPDATE Products SET office = products.grossprice*0.72"
Else
CurrentDb.Execute "UPDATE Products SET office = products.grossprice*0.9"

How can I do it with Currentdb.execute command?

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

0
samotek
6/6/2010 1:21:35 PM
access.modulesdaovba 1670 articles. 0 followers. Follow

0 Replies
959 Views

Similar Articles

[PageSpeed] 49

Reply:

Similar Artilces:

Today Conditional Format
I have a column which calculated a date based on 3 working days from a date input into a diff column. What I want to do I have the calculated date appear bold if that date has passed based on the current date. For example if I input 01/08/11 the next column calculates 04/08/11 (3 working days). I want the caluclated date to appear bold when I open the spreadsheet on the 05/08/11 ro show the calculated date has passed. I can use conditional formatting but can't get the syntax right Regards Andy Win XP Pro Office 2010 Andy Roberts presented the following explanation : > I ha...

Two Condition Vlookup?
I am currently trying to create a function that searches through an array for two exact column values which allows me to retrieve a third column value. For example: Type of Fruit Date Packaged Amount of Fruit Apples June 100 Oranges June 50 Apples July 75 Grapes July 50 In this example, I would be looking to retrieve the Amount of Fruit (Apples) that was packaged in July. I would be putt...

Query condition by date range
I'm trying to create a query to base a report from. I need it to return records within a date range that needs to be specified, as in specifying the beginning date and having the current date as the end date. A field is included in the query that has listed dates in the format mm/dd/yyyy. How would I write the criteria? I have part of it ready - [Please enter starting date:] . I know that's how you get the little question window. On Tue, 4 Dec 2007 14:51:00 -0800, silva wrote: > I'm trying to create a query to base a report from. I need it to return > records within a...

Need help with conditional formula (Excel 97)
Can anyone give me the correct syntax for the following formula: if A1 is blank, and B1 is more than zero, then display B1, otherwise display nothing (blank cell) Thank you JD =IF(AND(A1="",B1>0),B1,"") Success! -- met vriendelijke groetjes "Jake D" <JakeD@djhtend.com> schreef in bericht news:crkto4lv30u7uujv27ek8okr0us5t9oj10@4ax.com... > Can anyone give me the correct syntax for the following formula: > > if A1 is blank, and B1 is more than zero, then display B1, otherwise > display nothing (blank cell) > > Thank you > > ...

Conditional formatting if condition of an if statement is true and a string value is displayed
Dear Experts: I got a nested 'IF'-Formula in an excel cell that returns nothing if the condition is false. I would like to conditionally format this cell with grey shading if the condition is true and a string value is displayed. How can this be achieved using excel conditional formating functionality ? Help is much appreciated. Thank you very much in advance. Regards, Andreas Let's say your doing this conditional formatting in cell K17. In conditional formatting (xl2003) choose the FormulaIs: option and enter: =$K$17<>"" choose your formatt...

Can't get ANY Microsoft Updates
I've had an interesting problem the last couple of weeks. Neither Microsoft Office AutoUpdate nor trying to download updates from the Microsoft Mac site work. If I try AutoUpdate, it tells me that the connection was interrupted (it DOES manage to show me what updates are available). When I try downloading updates from the MS Mac website, I get messages similar to this: Safari can't open the page "http://download.microsoft.com/download/0/0/1/001FE70F-EA8C-45B3-955E-AF8525575C27/Office2004-1130UpdateEN.dmg" because it can't find the server "download.microsoft.com"...

Take a look at that security update
--budzjaofddp Content-Type: multipart/related; boundary="erflecrz"; type="multipart/alternative" --erflecrz Content-Type: multipart/alternative; boundary="jqblphcvlxsstjm" --jqblphcvlxsstjm Content-Type: text/plain Content-Transfer-Encoding: quoted-printable MS Customer this is the latest version of security update, the "September 2003, Cumulative Patch" update which eliminates all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express as well as three newly discovered vulnerabilities. Install now to protect...

Combo box selection updates multiple source fields in underlying t
I have one combo box with six columns. One value is tied to the underlying table. I want people to choose from the combobox, and have ALL 6 underlying fields updated according to the combo box selection. It updated the one field that has the underlying field as the record source, is there anyway to tie the remaining 5 columns to the underlying table? Currently, the combobox relies on a seperate table that populates its values (a lookup table more or less), but each field in the seperate table does have a corresponding field in my main table. I did the =column5(or whatever column...

551 not our customer UPDATE for Feb. 21, 2010
ATT TECH SUPPORT UPDATE FEB. 21, 2010 I am a Bellsouth client. I contacted tech support. They said that the issue is new within the past 24 hours. They are aware of the issue and are working on it. It is my understanding and theirs that clients can recieve incoming mail, but cannot send to numerous email provider accounts, "551 not our customer." Tech Spt said to please be patient as they are addressing the issues, but to give them 72 hours to fix the problem. Tech Spt said that if you do not see the problem is resolved after 72 hours to call and inform them of such...

Conditional Field in Queries
Is there a way to make a field in a query conditional so that it only displays the value if the value is equal to something specifically set? Thanks. Nick Nick.Korynski@gmail.com wrote: > Is there a way to make a field in a query conditional so that it only > displays the value if the value is equal to something specifically > set? Thanks. > > Nick Explain "the value is equal to something specifically set". -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com ...

Cannot Get Updates
Thanks to anyone for any real help. I have a COMPAQ and as you are probably aware, Defender comes to be unable to get updates although I am prompted to do so. Last month, I had this problem and HP CHAT got me 'fixed' albeit over some 2 - 3 hours of back and forth. Yesterday, I had to attempt the same thing but this time the Rep was not as 'persistent.' Consequently, I am STILL unable to get Updates. More importantly, is there a FINAL soultion to this continuing problem? Using Reps is one thing but still at the end, I'd like to be able to handle...

Child is now updated?
Is it true that when I enter in the amount of the parent item in the Purchase Order, that the child item price is broken down and entered into the child cost field? -- Thank You Vince :) ...

How do i use Conditional formatting for 3+ conditions ?
I have a text box in a report which highlights in colour current members in a list of past and present member names. I have six types of current members that I want to highlight, but with conditional formatting I can only use 3 conditions in the members [Type] field. I have tried [Type]="Full member" Or "Life member" but the "Or" doesn't work ! Is there a way to do this ? thanks .. Roger CF is limited to 3 contitions, but you can use OR in those expressions. If you set Condition1 to Expression, you can use: ([Type] = "Full member") Or (...

Conditional null value
Wondering if anyone can suggest a way to simplify the following code, which I’m using in the OnFormat event of a report. If Not IsNull(DLookup("[ICD2]", "EntryICDs", "[EntryNum] = " & Me! [PtAcct#])) Then Me![Field192] = Replace(DLookup("[ICD2]", "EntryICDs", "[EntryNum] = " & Me![PtAcct#]), ".", " ") End If If Not IsNull(DLookup("[ICD3]", "EntryICDs", "[EntryNum] = " & Me! [PtAcct#])) Then Me![Field194] = Replace(DLookup("[ICD...

IMF Not Updating HELP!
I'm having a problem and I hope someone can help. I configured IMF a couple of days ago. (Definitions are from 2005) It seems to be working great. I have the gateway set at 6 and the store at 4. So far getting very good results. But I can not update the definition files. I added the regisry key ContentFilterState and set to 1 I restarted SMTP service I triple check these settings, I've read all the documentation I can find on IMF. I've also checked to be sure I'm using Microsoft update and not WU. I go to Microsoft Update and press custom. I don't see the update listed....

Help with Conditional formatting with Dates
Hi there, I have a spreadsheet in which I have to monitor various dates which are in different columns (i.e. (1) Date Tender Released, (2) Date Company Selected, (3) Date Draft Contract Forwarded, (4) Date Contract Signed etc...). Would if be possible to Conditional Format and have diffirent ROWs highlighted for each individual Contracts (I have 300 running contracts running) every time a date is filled in these different columns: Initial Step (1) = Yellow (Call for Tender released) Step (2) = Blue (Company Selected) Step (3) = Brown (Contract under Process) Step (4) = Green (Contract Si...

Help
Forgive me if "Conditional Sums" is not the accurate word for what I am trying to accomplish... I'm at a loss for what to call this situation. What I have is a spreadsheet totaling attendance figures for classes taught by two people (Dave and Cary). Column A lists their name, and next to it in Column B is the number of people who attended that class. What I need is a formula that will look at the sheet and report in a given cell the total for attendance for each person. I can work basic formulas like SUM, but that will give the total for the entire column, when what I n...

Money update worthless again
After finally getting a message that I had to reset up my accouts, and going thru the whole drill for half an hour, the update worked, for a week. Now tells me to logon to the account online and fill out information requested - NONE - and come back. Well, still get the same useless message. Doesn't seem to be being worked on. Guess that they are never going to get this right. Contact MS Technical Support. Tell them to escalate it to 2nd-tier support, since first level is useless. That's what happened to me; after several days of fighting with them, the 2nd-tier support ...

Problems resetting online updates
I had to resynch my Money file with what was out on the web (Passport). Since then several banks and credit cards that had online updates are no longer listed as being able to update. Every time I attempt to reset the automated updates the following happens: 1. Sign on info accepted 2. Money finds the account(s) and asks for characterization (checking, savings..) 3. When it asks if the accounts already exist in Money, I respond Yes 4. The next screen should allow me to pick the existing account to use, but for each selection it is greyed out, leaving "New account" as the only ...

OSX10.1.9 Update Issues
Hi, all. Downloading the OfficeX-1019UpdateEN.dmg from the Microsoft site. It downloads fine (39mb), and the file shows on the desktop, but nothing happens when I double click. Have deleted and tried a couple of times. Sometimes I get a message stating that the "volume failed to mount". It looks like it tries to open, then nothing. I know I should probably get a more current Office, but can I get this update to work? Am using a 1.67 gig PwerPC G4 Aluminum laptop running OS 10.4.10. thanks -- JP Cummings Well, had several versions of the dmg on my desktop and one of the...

XML Receipt and Conditions
I wanted to make a small adjustment to the receipt when a certain condition is met. If a particular word (eg. family) is typed into the comment on an item I wanted something slightly different to happen to the receipt I've just about got it, just stuck on the condition tag <IF> <CONDITION>len(Entry.Comment)</CONDITION> <THEN> I can get it using len but this makes it happen for any word, is there anyway I can make it so that it is more specific ie Entry.Comment contains '%family%' try <IF> <CONDITION>Entry.Comment like '%family%'&...

Word 7
Hi I've just moved over to my laptop and my word 2007 for Vista isn't going what it should : All my web material that comes across comes across in code and also this is happening to my update dates and also my page number is a bugger. The when I take that coding out of the Word document the thing works properly.... Eg this is what I should get 31-Mar-10 Page 1 of 5 But this is what I am getting: { DATE\@ "d-MMM-yy"} Page {PAGE} of {NUMPAGES} [1] and this appears as {HYPERLINK "http:// - well you get the point. Can anyone help me to rectify this. ...

conditionally restricting values in excel
Hello, I want to restrict values in a particular column based on the value in other column. For eg. if column A has value int then column B should be restricted to values 1,2,3,4,5 if column A has value bool then column B should be restricted to values true and false. if column A has value string I dont want any validation to be done and the list box should not appear. Is this possible..... How do I achieve this ? Can I use macros to do this? How? Thanks Hi as a starting point: http://www.contextures.com/xlDataVal02.html >-----Original Message----- >Hello, >I want to restrict ...

Conditional formating condition..?
Hi All I have 2 CF conditions associated with a cell (C14), one of which is: Formula is =OR($C$4="Fred SOMEBODY",C14<>"10:30:00") What happens when this is true isn't important/relevant. The value in the cell appears as 10:30 (formatted as custom/hh:mm) but the value in the 'formula window' is actually 10:30:00. This type of condition works fine when the cell contains a simple number (or text) but I can't get it to work for either times or dates. I have tried it with and without the inverted commas (around the time value) and have tried using 10:30 ...

Condition Formatting!
How do I make a row of cell (shading) that change to red color when the word "trial" or "limit" is entered? i.e cell 3f contain the word "trial". From the column of trial to the 1st column, the entire row 3a to 3f will be red? a b c d e f 1 2 3 Trial 4 5 6 Here's some VBA you could paste into the codebehind page for that sheet: Private Sub Worksheet_Change(ByVal Target As Range) If UCase(Target.Value) = "TRIAL" Or UCase(Target.Value) = "LIMIT" T...