Results 1 to 2 of 2
  1. #1
    4 Star Lounger access-mdb's Avatar
    Join Date
    Dec 2009
    Location
    Oxfordshire, UK
    Posts
    507
    Thanks
    50
    Thanked 38 Times in 35 Posts

    Update query not working

    This has probably got a very simple answer, but it's driving me round the bend.
    I want to update a field which contains a filename (directory and filename) where the filename has spaces. I want to remove the spaces. The filenames are of the form:
    C:\Users\Pictures\C Olympus slides\Cx.jpg (where x is a 4 character number).
    I tried using an update query, with a new field to receive the new data (so I don't screw up the original filed) of the form

    left([scanname],26) + "C_Olympus_slides" + mid([scanname],43).

    But when I hit enter, it just comes up with "There was an error compiling this function - the Visual Basic module contains a syntax error. Check the code and recompile it". I am convinced I've done this sort of thing before and have a similar query on another table which doesn't have the error. Please help an old man from thinking he's completely lost his marbles.

    Many thanks

    Malcolm

    Oops, its Access 2003

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    4 Star Lounger access-mdb's Avatar
    Join Date
    Dec 2009
    Location
    Oxfordshire, UK
    Posts
    507
    Thanks
    50
    Thanked 38 Times in 35 Posts
    Well, I shut down the database, went away and tidied up the pets in the garden, then came back and tried with a different database (just a left function) and it worked. Went back to my original database - and guess what? It worked this time. So I'm not losing my marbles, but I have no idea why it decided to cause me grief (software doesn't deliberately cause grief to people does it?). I'm sure I restarted the database - perhaps I didn't (that much is down to age!).

Posting Permissions

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