Results 1 to 4 of 4
  1. #1
    The Professor is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2012
    Location
    Cambridgeshire, UK
    Posts
    67

    Enter Parameter Value

    Hi,

    I've written this SQL string to update the Post Code in the Customer table:

    SQL = "UPDATE tblCustomers " & _
    "SET [CustPostCode] = " & "[" & strEntry & "]" & _


    "WHERE [CustID] = " & ref

    DoCmd.RunSQL SQL

    I've included the square brackets because without them I was getting a 3075 expression error because the Post Code has a space in it. That error no-longer occurs, instead I'm now getting an "Enter Parameter Value" dialog box showing me the (updated) Post Code, but asking me to enter value - but the Post Code IS the value!

    Any ideas?

    Prof.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    Brackets are for fields.
    Quotes are for strings...(separated below for viewability)

    SQL = "UPDATE tblCustomers " & _
    "SET [CustPostCode] = ' " & strEntry & " ' WHERE [CustID] = " & ref

  3. #3
    The Professor is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2012
    Location
    Cambridgeshire, UK
    Posts
    67
    Hi ranman,

    Thanks very much for that.

    Prof.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Brackets can also be used to define other entities: tables, queries, forms, reports, controls. They will be required if naming convention includes spaces or special characters/punctuation (underscore is exception) or reserved words as the full name.
    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.

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

Similar Threads

  1. Enter Parameter Value
    By Everdale in forum Forms
    Replies: 5
    Last Post: 09-09-2013, 07:59 AM
  2. Replies: 13
    Last Post: 01-10-2012, 09:56 AM
  3. enter parameter value
    By alliandrina in forum Access
    Replies: 1
    Last Post: 06-05-2011, 01:02 AM
  4. Enter Parameter Value
    By T001 in forum Access
    Replies: 1
    Last Post: 08-11-2010, 05:43 AM
  5. Enter Parameter Value
    By plesser in forum Access
    Replies: 1
    Last Post: 11-08-2008, 10:27 AM

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