update or cancelupdate without addnew or edit

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi
i need help
this is my code in my form_current sub
lbproperties is a listbox
the code run great, but when i try to move records or close the form etc. i
get this message: "update or cancelupdate without addnew or edit"
please advise

Private Sub Form_Current()
RefreshForm
End Sub

Sub RefreshForm()
lbProperties.RowSource = "select * from qrproductlists where productcode=" &
ProductID
lbProperties.Selected(0) = True
End Sub
 
I see nothing in that snippet that should be generating that error message.
You sure that's what's causing the error?
 
Do you have any code on the BeforeUpdate event of the form?
When you get the error, press Ctrl+Break to see where the code stop.
 
thanks ofer
it was a problem in ms access. i tried it in another pc and it worked just
fine.
thank you very much anyway
"HTH" ani kvar beemet lo yodea ma ze, chag sameach
 
hi again
its acting up again
this time on the other pc, access crashes entirely
on this pc i get the message. ctl-brk just tells me that its impossible to
save the record.
what i realized is that if i remove the "lbProperties.Selected(0) = True"
line, then everything goes fine
please help
thanks
 
I tried this code and it works fine, I tried when the RowSource return values
and when it doesn't.
I assume you tried compact and repair, I would give it another chance and
create the form again, sometimes a form is corupted and it can cause this
problem.

HTH = Hope That Help
Chag Pesach sameach gam lecha
חג פסח שמח
 
Back
Top