3 Replies - 461 Views - Last Post: 04 September 2017 - 07:41 AM Rate Topic: -----

#1 Envien  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 03-September 17

try to look at my codes for EDIT and tell me whats wrong..

Posted 03 September 2017 - 07:51 AM

Hi.. Whenever i try to edit the data that has been saved on access it says that "syntax error on UPDATE statement?? Can anyone help me here??

 If editflag = True Then
    con.Execute "UPDATE studentry_tbl set Lastname='" & Me.txtln & "', Firstname='" & Me.txtfn & "', MidInt='" & Me.txtmi & "', Department='" & Me.cbodept.Text & "', Course='" & Me.cbocourse.Text & "', Major='" & Me.cbomajor.Text & "', YearLvl='" & Me.cboyr.Text & "', Section='" & Me.cbosec.Text & "', Semester='" & Me.cbosem.Text & "', SchoolYear='" & Me.txtsy & "', StudType='" & Me.cbotype.Text & "', Type='" & Me.cbostud.Text & "' Where StudentID = '" & (Me.txtsid.Text) & "'"
    MsgBox "Successfully Save!", vbInformation, "System Message"
    cmdSave.Caption = "Add"
    addflag = False
    DGStudEntry.Enabled = True
    Call disable_txtbox
    Call Load
    Call clear
    Exit Sub
 End If 


Is This A Good Question/Topic? 0
  • +

Replies To: try to look at my codes for EDIT and tell me whats wrong..

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 13491
  • View blog
  • Posts: 53,888
  • Joined: 12-June 08

Re: try to look at my codes for EDIT and tell me whats wrong..

Posted 03 September 2017 - 08:54 AM

I would suggest printing out line 02 to a file, or the console, and see what it looks like.

One of the reasons why parameters help with readability..
Was This Post Helpful? 0
  • +
  • -

#3 Envien  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 03-September 17

Re: try to look at my codes for EDIT and tell me whats wrong..

Posted 03 September 2017 - 04:17 PM

Thanks.. Its already working....
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 13491
  • View blog
  • Posts: 53,888
  • Joined: 12-June 08

Re: try to look at my codes for EDIT and tell me whats wrong..

Posted 04 September 2017 - 07:41 AM

What did you do to fix it?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1