Edit Update not working on MS Access? -


i'm new ms access. basic stuff. i'm doing edit button in ms access forms, keep getting runtime errors. here code:

currentdb.execute " update flight set " & _ "std= ' " & me.text3 & " ' " & _ ",destination = ' " & me.text5 & " ' " & _ ",remark = ' " & me.text7 & " ' " & _ ",etd = ' " & me.text9 & " ' " & _ ",atd = ' " & me.text11 & " ' " & _ ",ofbl =  ' " & me.text13 & " ' " & _ ",car= ' " & me.text15 & " '  " & _ ",nature = ' " & me.text17 & " ' " & _ ",reg_n0 = ' " & me.text19 & " ' " & _ "where flight_nr = " & me.text0  flightsubform.form.requery 

is field flight_nr integer field (1,145) or text field (kq145)?

if integer field might need change statement capture me.text0 integer below:

" flight_nr = " & int(me.text0) 

if text field might need add quotes around me.text0 value capture text:

" flight_nr = " & " ' " & me.text0 & " ' " 

edit:
change code debugging follows:

my_sqltext =  " update flight set " & _ "std= ' " & me.text3 & " ' " & _ ",destination = ' " & me.text5 & " ' " & _ ",remark = ' " & me.text7 & " ' " & _ ",etd = ' " & me.text9 & " ' " & _ ",atd = ' " & me.text11 & " ' " & _ ",ofbl =  ' " & me.text13 & " ' " & _ ",car= ' " & me.text15 & " '  " & _ ",nature = ' " & me.text17 & " ' " & _ ",reg_n0 = ' " & me.text19 & " ' " & _ " flight_nr = " & " ' " & me.text0 & " ' " debug.print my_sqltext 'will print immediate window inspection currentdb.execute my_sqltext   update flight set std= ' 4:55:00 pm ' ,destination = ' ath ' ,remark = ' dep ' ,etd = '  ' ,atd = ' 5:15:00 pm ' ,ofbl =  ' 5:05:00 pm ' ,car= ' a3 '  ,nature = ' j ' ,reg_n0 = ' za_a309 '  flight_nr =  ' a3 847 '        update flight set std= ' 4:55:00 pm ' ,destination = ' ath ' ,remark = ' dep ' ,etd = '  ' ,atd = ' 5:15:00 pm ' ,ofbl =  ' 5:05:00 pm ' ,car= ' a3 '  ,nature = ' j ' ,reg_n0 = ' za_a309 '  flight_nr =  ' a3 847 '  

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -