Results 1 to 8 of 8
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Find and Replace Dialog Box (2000)

    I'm trying to use "Find and Replace"(see attached picture) to substitute the year 2001 for 2002 in the Date field of the attached table but I get the message, "You can't search the field for the specified value".
    What am I doing wrong?
    Attached Files Attached Files

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Find and Replace Dialog Box (2000)

    I could be wrong, but I thought Find and Replace was meant to find field names (in a table) and change that name in all relevant queries, forms and reports, etc.
    HTH
    Pat <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  3. #3
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Find and Replace Dialog Box (2000)

    Unfortunately you can't use "find and replace" on portions of a date field, as it is stored in numeric fashion. It sounds as if you want to move each date ahead one year. I would suggest one of two strategies - use the DateAdd function as part of an update query, or use the DateSerial function to create a new date with the only the year changed, again using an update query. In either case, if you have dates which are not 2001, you may want to restrict the update query with a criteria that says Between 1/1/2001 and 12/31/2001
    Wendell

  4. #4
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Find and Replace Dialog Box (2000)

    For sample table you provided, you can use this SQL for update query:

    UPDATE [Copy Of Tabella1] SET [Copy Of Tabella1].[Date] = DateSerial(Year([Date])-1,Month([Date]),Day([Date]));

    Note that "DATE" is not good name for a Date/Time field since Date is also a function defined in VBA.

    HTH

  5. #5
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find and Replace Dialog Box (2000)

    Thanks Wendell

  6. #6
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find and Replace Dialog Box (2000)

    Thanks Mark

  7. #7
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find and Replace Dialog Box (2000)

    Pat, isn't that the AutoCorrect feature?

  8. #8
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Find and Replace Dialog Box (2000)

    No, it's not, the AutoCorrect feature straight from A97 help is:

    You can use the AllowAutoCorrect property to specify whether a text box or a combo box control will automatically correct entries made by the user.

    Pat <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

Posting Permissions

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