Access VBA throwing unlisted error code -
i'm seeing error code in access 2000 vba:
-2147352567-record in '[sometable]' deleted user.
so, 2 questions:
1) how handle/avoid error code this?
2) can explain why i'm getting error code doesn't seem exist in ms documentation? , there way decipher code? combination of several codes? guidance on topic appreciated.
public sub form_open(cancel integer) ' check unposted record / regardless of date / shift ' if there unposeted record goto dim lcheck dim spress string on error goto form_open_err gotorecord: if bpressconsumptionopenran = true lcheck = dlookup("pressconsumptionid", "spi_getunpostedrecord") if not isnothing(lcheck) me.txtpressconsumptionid.setfocus docmd.findrecord lcheck else docmd.setwarnings false docmd.openquery ("spi_insertnewpressconsumption") me.requery docmd.setwarnings true end if end if form_open_exit: exit sub form_open_err: serrmsg = err.number & "-" & err.description msgbox serrmsg, vbcritical + vbokonly + vbinformation, "program error"
so commented out
on error goto
lines in form_open(), form_load(), , form_activate(), , still no debugger call. error shown when db opened, have no idea else error in code.
and here code isnothing:
public function isnothing(vcheck variant) boolean on error goto isnothing_err if isnull(vcheck) isnothing = true: exit function if isempty(vcheck) isnothing = true: exit function if trim(vcheck) = "" isnothing = true: exit function isnothing_err: isnothing = false end function
now i'm getting similar error in form_current():
private sub form_current() dim suser string on error goto form_current_err if isnothing(me.dtpusagedate) me.dtpusagedate = date 'this line throws error. end if ...ommitted save space. not relevant... form_current_err: serrmsg = err.number & "-" & err.description msgbox serrmsg, vbcritical + vbokonly + vbinformation, "program error" resume form_current_log form_current_log: on error resume next call logerror(serrmsg, "pressconsumptions_form_current") goto form_current_exit end sub
error message:
-2417352567-there no object in control.
is message related other 1 we've been seeing? thoughts on correcting?
the error number , message suggest me problem outside of access. fact you're executing saved query has name suggesting runs sproc on database server suggests me end sql server or other end.
it's common error in access when don't have both primary key , timestamp field in end table. it's caused fact access can't tell record involved , can't refresh display appropriately. having pk , timestamp field gets rid of problem.
but may caused else, of course.
Comments
Post a Comment