access vba - How to run function in vba using data macro? -


i new data macro in ms access 2013 , need it. lets assume have simple database 1 table of users. when change "age" field in table, want run external exe file (the reason why dosent matter). learn subject during last few days , end this: 1. build module in ms access called runminifix (minifix name of exe file want run). module uses shellexecute function , whole module looks that:

option compare database const sw_show = 1 const sw_showmaximized = 3  public declare function shellexecute lib "shell32.dll" alias "shellexecutea"    (byval hwnd long, _    byval lpoperation string, _    byval lpfile string, _    byval lpparameters string, _    byval lpdirectory string, _    optional byval nshowcmd long) long  public function runminifix()      dim retval long      on error resume next      retval = shellexecute(0, "open", "c:\program files\minifix\minifix.exe", "<arguments>", _                         "<run in folder>", sw_showmaximized) end function 

now, when activating module, works fine , exe file running.

  1. in ms access, build data macro based on 'if then' statement, asking if [users]![age] > x , calls build-in runcode event action catalog calls runminifix function. now, when saving data macro, ms access pops message box saying microsoft access dosen't have ability find name "users" mentioned in phrase , recommend me right control in form. "the form"? yes, form! database not form based. have no gui designed ever. have no buttons or click event handle. asking how can trigger runminifix module when age field modify. please, important!

    thanks head,

    oron.

please use setlocalvar action list in data macro , set expression name of function sample: name "test" expression =runminifix()


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -