sql - Access - Reference to a form element in a data macro -
i have simple info macro in access 2013. before alter info macro.
it setfield macro. in "value" field need reference value in textbox in form, how can do? tried write [forms]![form_name][textbox_name], can see in image below (in italian), doesn't work.
this error receive:
in english language can translated "unable find identifier"
you cannot reference access or screen/form objects in info macro. info macro same thought sql store procedure. store produce runs @ database engine level. in fact can open database vb.net, or foxpro , info macros still run.
so info macros independent of application. info macros have local variables, , same thought , concept of store procedures in sql server. info engine level code only.
the info engine , store procedure (data macros) cannot reach out , grab info “host” application foxpro, vb.net or ms-access happens have form open. info macro not know or see application (vb.net, c++, ms-access) using ace database engine.
the suggested workarounds thus:
don’t reference forms value, reference table column value (this assumes column in same table). can lookup values other tables. code in info macro table level only.
if must pass or utilize forms! value in such code, why not place code in forms before update event opposed using info macro? means can utilize vba code. don’t need nor want engine level stored procedure routine writing.
you can pass value form info macro, means not using table events trigger , phone call such code (you utilize rundatamacro , pass parameters).
so can phone call info macro access form, such code not triggered nor called table level events.
so store procedure code cannot “reach out” application happens using access database engine.
sql ms-access ms-access-2013
No comments:
Post a Comment