Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Mar 2002
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The following code works when I type 4.1 but not with 4.10. Any ideas why?

    Dim strSQL As String
    Dim smp As DAO.Recordset

    strSQL = "Insert into tblDatabase ( EmployeeNumber, TaskNumber) Select People.EmployeeNumber, " & Task & " as TaskNumber from People"
    CurrentDb.Execute strSQL, dbSeeChanges

    Thanks.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Is TaskNumber a text field? If so, change the line strSQL = ... to

    strSQL = "Insert into tblDatabase ( EmployeeNumber, TaskNumber) Select People.EmployeeNumber, " & Chr(34) & Task & Chr(34) & " as TaskNumber from People"

    Chr(34) is the double quote character " that is required around text values.

Posting Permissions

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