Results 1 to 7 of 7
  1. #1
    Kash is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Posts
    4

    Update Query for blanks getting type conversion failure.

    I basically have been thrown into fixing some databases and am relatively new to access. I feel like I am close to resolving this issue but any help is appreciated.

    I have a table in access that has some blank fields I am trying to resolve. Here is how it looks like.


    Account Client Name Product Code (these are all listed at text type fields)



    Account Number Client Name Product Code
    A100 John X
    A100 D
    A101 Debbie S
    A102 David D
    A102 X


    What I want to do is make fill in the data with update query so the table looks like this.

    Account Number Client Name Product Code
    A100 John X
    A100 John D
    A101 Debbie S
    A102 David D
    A102 David X


    So I made a query like this

    Nz([Client Name], DLookUp("Client Name","Customer","Account Number=" & [Account Number] & " AND Not [Client Name] Is Null"))

    and in the update query section I have set the query to is Null. Now it tells me there is about 4000 records like this would I like to update but when I hit yes I get this error.

    Microsoft Access didn't update due to a type conversion failure with 0 violations.

    So I figure it is a syntax issue but even after the changes I made I still get the same error. So any guidance is appreciated here.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Criteria for text field type needs apostrophe delimiters:

    Nz([Client Name], DLookUp("Client Name","Customer","Account Number='" & [Account Number] & "' AND Not [Client Name] Is Null"))

    Dates use # and numbers nothing.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Kash is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Posts
    4
    Quote Originally Posted by June7 View Post
    Criteria for text field type needs apostrophe delimiters:

    Nz([Client Name], DLookUp("Client Name","Customer","Account Number='" & [Account Number] & "' AND Not [Client Name] Is Null"))

    Dates use # and numbers nothing.

    Still getting the same error, maybe its just me and how i am putting the query in. I even made a sample table to double check. Thank you at least I have the format right now.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Is [Client Name] really a number field that stores ClientID (as should be) and has a Lookup for the client name?

    If so, setting Lookups in tables bites again. I don't set Lookups in tables.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Kash is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Posts
    4
    No it is a textfield with the Client name, there is no client id. Does that need an apostrophe also?

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Oops, Client Name and Account Number have a space, include brackets - "[Client Name]", "Customer", "[Account Number]=". This is why I don't use spaces or special characters in names or reserved words as names.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    Kash is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Posts
    4
    Quote Originally Posted by June7 View Post
    Oops, Client Name and Account Number have a space, include brackets - "[Client Name]", "Customer", "[Account Number]=". This is why I don't use spaces or special characters in names or reserved words as names.
    That's it, you made my day amazing. Thank you very much.

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

Similar Threads

  1. Data Type Conversion Error
    By graviz in forum Forms
    Replies: 7
    Last Post: 06-04-2012, 11:34 AM
  2. Help need: Type conversion failure
    By tami in forum Access
    Replies: 1
    Last Post: 01-18-2012, 07:18 AM
  3. Type Conversion Failure
    By fpmsi in forum Access
    Replies: 7
    Last Post: 09-22-2011, 11:25 AM
  4. SQL Update with blanks
    By Tyork in forum Programming
    Replies: 1
    Last Post: 12-17-2010, 10:12 AM
  5. Data Type Conversion in Query
    By EHittner in forum Queries
    Replies: 3
    Last Post: 04-14-2010, 02:11 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