replacing values based upon a different field having a word within a description

mac

    Next

  • 1. Open ODBC table and concatenate field
    I want to design a marco that will automatically open up a table and concatenate several fields into one field call the NEW GRANT ID. Is there a way to perform this??? If so can you fully explain. Keep in mind this is my first macro!!!
  • 2. Macro to create report html with current date in filename
    We need to generate a report html every day automatically. The same report, but have it write the filename out as: OrderStatusMMDDYY.html We don't want the user to have to enter it in...how can we do this?
  • 3. Copy from Form to Subform
    I am trying to copy data from a field in a form to a combobox (dropdown field) in a subform using a macro. GoToControl Application RunCommand Cop GoToControl Forms![_Product_OLD_DATA Query]![Move Productxx].Form![Combo34] RunCommand Past The name in the properties section of the field I want to copy to is Combo34. I get an error message telling me there is No Field Named Combo 34 in the Current Record. It does not seem to be finding the subform. How do I bring up the subform so It can find combo 34 I have tried to use just Combo 34 and the name of the new field, Application alone with no luck.
  • 4. Create Macro to print current record in form only
    Without using the button wizard, does anyone know the steps for creating a Macro to print current record in form only? I have: 1. OpenForm 2. PrintOut It prints ALL the records, not just the one it's on. Thanks!

replacing values based upon a different field having a word within a description

Postby gdwojo » Fri, 20 Jan 2006 03:40:58 GMT

I need to find  all records in the database and then make a change in a
different field of that record based on whether the text exists in the field.


I have a pricing database where I have a discounting scheme that I apply.   I
take the list price, apply a discount, and then determine if the price is a
minimum percentage above my cost.  If the discount makes the price less than
the minimum profit, then I make the customer price the minimum profit,
otherwise I apply the discount that I have determined.   However,  on one
specific group of items, I apply a different discounting scheme.  For every
one of these specific items (call them widgets) the word widget appears in a
long description field.   For all widgets, if I want to  change the
percentage of discount so I need to find all widgets and then replace the
discount percentage.

If all items are discounted at 20%, and I need widgets to discount at 30%
then I would like to change the value of my discount field for that record
from .20 to .30.  Anybody have any ideas?

Is there any way to do this.   - If not, how do I just put a record that I
can search on that tells me that the word widget shows up in the description
field??

Similar Threads:

1.replacing values based upon a different field having a word within

I suggest coping the table just in case.

First create a select query and in the 'long description field' criteria use 
Run the query and review the data to make sure you are not pulling records 
that you do not want to change.  If there are unwanted records then devise 
additional criteria to eliminate them.

Then change query type by clicking on the icon bar the two pages with down 
arrow on the right and select Update Query.  Enter the new information in the 
design grid. and run the query.

"gdwojo" wrote:

> I need to find  all records in the database and then make a change in a
> different field of that record based on whether the text exists in the field.
> 
> 
> I have a pricing database where I have a discounting scheme that I apply.   I
> take the list price, apply a discount, and then determine if the price is a
> minimum percentage above my cost.  If the discount makes the price less than
> the minimum profit, then I make the customer price the minimum profit,
> otherwise I apply the discount that I have determined.   However,  on one
> specific group of items, I apply a different discounting scheme.  For every
> one of these specific items (call them widgets) the word widget appears in a
> long description field.   For all widgets, if I want to  change the
> percentage of discount so I need to find all widgets and then replace the
> discount percentage.
> 
> If all items are discounted at 20%, and I need widgets to discount at 30%
> then I would like to change the value of my discount field for that record
> from .20 to .30.  Anybody have any ideas?
> 
> Is there any way to do this.   - If not, how do I just put a record that I
> can search on that tells me that the word widget shows up in the description
> field??
> 

2.change drop down list contents based upon value from another list

3.Automatic Hiding of Tables based upon value in first cell

I am creating a Word 2002 document from mail merge that may have hundreds of 
records (and so hundreds of pages), usually generating 2 or 3 pages per 
record. The data (from my family history hobby) is being merged onto the 
document into separate tables. For example the first table would be the 
persons name and address, then the second table could be names of parents, 
the third table names of grandparents, the fourth great-grandparents, etc.

The problem is that in many cases there is no actual data in every table and 
so this is resulting in empty tables and wasted paper as there is no need to 
print the empty tables.

I can produce the data so that I can put a flag as the first cell for each 
table to indicate if it should be hidden or not.

I am therefore looking to run a macro after the mail-merge to go through the 
document and see if there is any value in the first cell of the table, if so, 
no problem, if no value then I want to hide the whole table so that nothing 
is shown and the rest of the data moves up. Then carry on down through the 
document repeating the process. I should then have a document that contains 
some pages with a record that has only one table, other records with maybe 3 
tables, etc.

I have never done a Word macro before so some simple tips and steps would be 
appreciated. Many thanks in advance.

4.select based on word CDS being in description field

I have a column in a spreadsheet of data which describes certain investments. 
 A certain type of investment's description always contains the initial 
"cds".  I would like a formula to look at the field and if the letters cds 
appear (in that order) I would like do some math on other parts of the record.

For example  if cell b1 contains the letters cds, then add cell c1 and d1, 
else 0)

Any help would be appreciated

Joe


-- 
Joe D

5.Set value of text box based upon value in another field

I have a report "rptMoveDates" that has a 
field "MoveCDate" that contains dates of office items 
that are moving.  If the date is 1/1/04 or earlier the 
item is not moving and being listed for inventory 
purposes.  I have a text box "txtMoveStatus" that I would 
like to set the value of to "Moving" if MoveCDate is 
later than 1/1/04 or "Not Moving" if MoveCDate is earlier 
than 1/1/04, or "PlaceHolder" if MoveCDate is = 7/4/04.  
Is this possible using the afterupdate property of 
MoveCDate and would it be an IF/Then type of statement?  
Any help would be appreciated.  Thank you.  - scott

6. Sum of field value based upon multiple instances of another value

7. Question on having a form field appear based on content of another field

8. Help: set values of two fields based on value of a third



Return to mac

 

Who is online

Users browsing this forum: No registered users and 92 guest