Hi everyone,
I need to have an Access-AddIn which is able to read/write data into its own tables/queries by
programming. That means, I have to find out who I am:
sub WriteIntoMe()
dim DB as database
dim RS as recordset
set db=Opendatabase(...whoAmI?...,false) 'here's my problem!
set RS=db.openrecordset("ExistingQueryInAddin",dbopendynaset)
rs.addnew
rs.fields("MyField").value="This is new"
rs.update
end sub
Obviously I can't use "CurrentDB()" or "DBEngine(0)(0)" as they represent the visible database and NOT
the addin database.
I know how to read the
"HKEY_LOCAL_MACHINE\Software\Microsoft\Office\8.0\Access\Menu-AddIns\MyOwnAddIn\Library" value with the
path of my Addin database. But that's a lot of undesired (API-)code and I can't believe there's no
"ThisDB()"-construction like WinWord's "ThisDocument"?! I tried several "...parent" ideas but with no
success either.
And BTW, how can I import tables/queries/forms from an Addin database into the currentdb by programming?
Thanks in advance, Lorenz