Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2004
    Posts
    19

    Unanswered: Update query help.. thanks

    I have a form.. with a combo box with names from my query.
    I have a checkmark box from my table..

    I want to be able for the user to select name with combo list.. hit a button and that check mark box will become check in that table.

    ok now what I've done..

    set the default check mark box to true..

    and the code behind the button:

    Code:
    Private Sub bSave_Click()
    
    Dim f1 As String
    Dim f2 As Boolean
    Dim strSQL As String
    
    EmpName.SetFocus
    f1 = EmpName.Text
    DelEmp.SetFocus
    f2 = IIf(DelEmp = True, True, False)
    
    strSQL = "UPDATE Table1 SET Table1.DelEmp = " & f2 & "  WHERE Table1.Name = " & f1 & ""
    CurrentDb.Execute strSQL
    
    End Sub
    now the error i get when i run the code:

    Run-Time error 3075

    Syntax error (comma) in query expression 'Table1.Name = Name in Table'.

    Did I do something wrong ?

    thanks

  2. #2
    Join Date
    Jun 2004
    Posts
    96
    hi, name field is text/string data type?

    try enclosing the name with ' '.

    "UPDATE Table1 SET Table1.DelEmp = " & f2 & " WHERE Table1.Name = '" & f1 & "'"

  3. #3
    Join Date
    Jun 2004
    Posts
    19
    stupid me.. how could i miss that..

    thanks for your help!

Posting Permissions

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