+ Reply to Thread
Results 1 to 9 of 9

If Value is Empty on the table

  1. #1
    Forum Contributor
    Join Date
    09-21-2015
    Location
    nederland
    MS-Off Ver
    2021
    Posts
    203

    If Value is Empty on the table

    Please help how to handle this issue on the "Table"
    If the State field is empty then it must be replaced with Text = DPS

    thank you in advance

    Kirana
    Attached Images Attached Images
    Last edited by kirana2014; 07-25-2021 at 04:50 AM.

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: If Value is Empty on the table

    If this is a one off action then highlight the table column and press Ctrl+H to bring up the find and replace box.
    Leave the "Find What" field blank, put DPS in the "Replace With" field and click "Replace All".

    If this is something you need to do frequently then you could add a short macro that can be run to replace blanks with DPS on the selected range.

    BSB

  3. #3
    Forum Contributor
    Join Date
    09-21-2015
    Location
    nederland
    MS-Off Ver
    2021
    Posts
    203

    Re: If Value is Empty on the table

    Dear BSB,

    Can you Help me please with the macro?

    thank you in advanced

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: If Value is Empty on the table

    Try this. You'll need to change the parts in red to the relevant sheet and table name.
    Please Login or Register  to view this content.
    BSB

  5. #5
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,302

    Re: If Value is Empty on the table

    With a macro

    Please Login or Register  to view this content.
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  6. #6
    Forum Contributor
    Join Date
    09-21-2015
    Location
    nederland
    MS-Off Ver
    2021
    Posts
    203

    Re: If Value is Empty on the table

    Dear,

    This not in excel but on ms access! ( see picture)

  7. #7
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: If Value is Empty on the table

    Apologies I hadn't noticed it was in the Access forum and the original picture in post #1 didn't make it obvious it was Access.

    Create a new query (not using the wizard) and change it to an "Update" query then fill out the grid as below.
    Field: State
    Table: Table1
    Update To: "DPS"
    Criteris: Is Null


    When you run the query all blanks in the State field will be updated to DPS.

    Change Table1 to the real table name.

    Worth pointing out that it's worth trying this on a COPY of the database first!

    BSB
    Last edited by BadlySpelledBuoy; 07-25-2021 at 05:30 AM.

  8. #8
    Forum Contributor
    Join Date
    09-21-2015
    Location
    nederland
    MS-Off Ver
    2021
    Posts
    203

    Re: If Value is Empty on the table

    Dear BSB,

    Is working, the question How to run automatic the update query ?

  9. #9
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: If Value is Empty on the table

    I'm not sure I understand. You'd need some kind of trigger to run run the query and I know nothing about your database to be able to guess what that trigger could be, so you're going to have to provide some detail here.

    If you want blanks in that field to always be "DPS" then you can set that as the default value for the field. That way if the user leaves it blank it will default to DPS.

    BSB

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Formula to return empty string instead of null when column table is empty
    By jaryszek in forum Excel Formulas & Functions
    Replies: 26
    Last Post: 02-14-2020, 06:37 AM
  2. How to write VBA code to clear a table but preserve table and 1 empty row
    By kwoltman in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-28-2019, 07:26 PM
  3. sum a range of cells from empty to empty cell in a big table
    By Ram71 in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 03-09-2018, 03:12 PM
  4. Paste to first empty row in a table (NOT at the end of the table range)
    By mick0005 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-18-2015, 05:36 AM
  5. [SOLVED] macro emptying table also to work when table is empty
    By pallie in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-11-2014, 05:00 AM
  6. Delete Empty Rows and empty columns from the word table
    By mvneema in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-25-2014, 10:51 AM
  7. UserForm to transfer items from one table to another table in the next empty cell...
    By aneese11 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-04-2012, 10:31 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1