What is wrong in this code ?

rs.Open " update TblName set FldNum=" & text1.Text & " where ID_FldName=" & Text2.Text , db, adOpenDynamic, adLockOptimistic

Knowing that
FldNum ---> Data type (Number)
ID_FldName ---> Data Type (AutoNumber)

And What the correct code ?

Looks like you have it... Only need to add single ticks around strings and since both of your fields are numeric, I think you have it...

Good Luck

Try using

rs.Open "update TblName set FldNum = '" & Text1.Text & "' where ID_FldName = '" & Text2.Text & "'", db, adOpenDynamic, adLockOptimistic

Hope this helps

Kin, please reread this thread...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.