title: Microsoft Access/Updating Record
body: <p>Can anyone help me with the below code to edit the records please?Im trying to edit but there is a Syntax error and I cant fix that.
  See the error that appears below. 
   Run Time Error '3075'
   Syntax Error(missing operator) in query expresion 'TypeID='.</p>
  
  <h1>Thanks</h1>
  
  <pre><code>Private Sub oshaadd_Click()
  'On Error Resume Next
  
     If (IsNull(Me.oshaID) Or (Me.oshaID = "") And IsNull(Me.oshatype) Or              (Me.oshatype = "")) Then
       MsgBox "please fill required fields!", vbInformation, "Information"
        Exit Sub
     End If
  
  If Me.oshaID.Tag &amp; "" = "" Then
      CurrentDb.Execute "INSERT INTO osha(TypeID, OSHA)" &amp; _
      "VALUES ('" &amp; Me.oshaID &amp; "', '" &amp; Me.oshatype &amp; "')"
          If MsgBox("Added", vbOKOnly) Then
              Me.osha_subform.Form.Requery
          End If
      Else
  
      CurrentDb.Execute "UPDATE osha " &amp; _
      "SET TypeID =" &amp; Me.oshaID &amp; _
      ", OSHA = '" &amp; Me.oshatype &amp; "'" &amp; _
     "WHERE TypeID =" &amp; Me.oshatype.Tag
         MsgBox "Updated", vbInformation, "Information"
         Me.oshaadd.Caption = "Add"
         Me.oshaedit.Enabled = True
  End If
  Me.osha_subform.Form.Requery
  End Sub
  
  
  
  Private Sub oshaedit_Click()
  On Error Resume Next
  If Not (Me.osha_subform.Form.Recordset.EOF And     Me.osha_subform.Form.Recordset.BOF) Then
      With Me.osha_subform.Form.Recordset
          Me.oshaID = .Fields("TypeID")
          Me.oshatype = .Fields("OSHA")
  
          Me.oshaID.Tag = .Fields("TypeID")
          Me.oshaadd.Caption = "Update"
          Me.oshaedit.Enabled = False
       End With
  End If
  End Sub
  </code></pre>