Results 1 to 5 of 5
  1. #1
    darrellx is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2006
    Posts
    7

    Replacing data in a field.

    I have a price sheet that has many blank price fields. I would like to replace these empty record fields with "POR" when the price field is blank.

    I think that I do this with an if then query but am not sure how to do it.

    Any help is appreciated.

    Thanks in advance

    darrellx

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    use the find and replace dialog in the table, or in a query write:

    Code:
    UPDATE table SET table.field = 'POR' where table.field IS NULL

  3. #3
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Hi
    I have a price sheet that has many blank price fields. I would like to replace these empty record fields with "POR" when the price field is blank.
    This can be done with an Update query. Take a look at that and if you need more help, post back.

    To get "POR" entered with all new records I would set the Default property for the field at table level. I would also use a little code to validate the field's value in the Before Update property of the form in which new records are created.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  4. #4
    darrellx is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2006
    Posts
    7
    That was easy enough. Thanks

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I would think that the Price field would be a numeric field and "POR" is a string (text). You could easily cause the field to be displayed on a Form/Report as "POR" when there is no value. I would not recommend that you set this field as Text however since you would almost certainly want to use it in a calculation somewhere else in the system.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Compiling Data, Not Replacing
    By helpaccess in forum Access
    Replies: 12
    Last Post: 03-08-2011, 03:13 PM
  2. Replacing data in Table
    By JackT in forum Import/Export Data
    Replies: 1
    Last Post: 08-23-2010, 10:34 AM
  3. Replacing text for a report
    By Zaram in forum Reports
    Replies: 7
    Last Post: 02-23-2010, 12:27 PM
  4. Replacing Null with 0
    By gilagain1 in forum Queries
    Replies: 5
    Last Post: 04-23-2009, 01:47 PM
  5. Replacing text in my database
    By sbrobin in forum Access
    Replies: 0
    Last Post: 02-08-2009, 02:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums