Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    330
    Thanks
    10
    Thanked 0 Times in 0 Posts
    I have a table called tblAllocate.
    One of the fields is a lookup field called Job# which has numbers in it eg 55548 and the field in the table it looks to is definitely a number field.
    I am trying to do the following in a button code on a form:

    CurrentDb.Execute "DELETE * FROM tblAllocate WHERE Job# = " & [Job#]

    but I get the error

    Run-time error '3075':

    Syntax error in date in query expression 'Job# = 55548'


    but I don't have any dates in the table or expression?????

    Help?
    "Heading for the deep end"

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    The use of # in the field name is causing the problem. # is used to precede dates in SQL.

    It is best to avoid all special characters in field names. Can you rename the field to JOBID?
    Regards
    John



  3. #3
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    330
    Thanks
    10
    Thanked 0 Times in 0 Posts
    Thanks John,

    Done and done! Problem solved.
    "Heading for the deep end"

Posting Permissions

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