By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,660 Members | 1,037 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,660 IT Pros & Developers. It's quick & easy.

referencing forms / modules without opening them

P: n/a
Hi I've been trying to create an addin similar to Find & Replace from Rick
Fisher that looks thru your tables / queries / forms / modules etc.. for a
reference to a string and optionally let's you replace it.

In order to get this to work I need to get

- the tablenames and columnnames
- the queries in plaintext
- the properties of a form and the properties of elements contained within
it
- the sourcecode in the various vb modules formmodules and classmodules

I found out that for queries and tables this is fairly simple using DAO

However things get's a bit daunting with forms and modules since I can't
seem to find a way to access these objects without opening them

You can reference stuff thru Application.Forms and Application.Modules but
these only contain the currently opened forms / modules and I need *all*
forms

CurrentProject.AllForms lists all forms but returns only AccessObject's
which basicly means I can only get the name of form and if it's been loaded.
But I can't reference it without loading it which is well let me say pretty
anoying

I know I can do

DoCmd.OpenForm formName, , , , , acHidden

and then later close it, but that seems rather hackish and has some problems

For modules things get even more messy since I don't think you can open a
module in hidden mode, So when I open the form with DoCmd.openModule the vba
environment pops up. not very elegant.. to say the least

The only workaround I've found sofar is using the *shrug* undocumented
Application.SaveAsText function to look inside the code , change it on disk
and then reeimport it with Application.LoadFromText

Could someone suggest a more elegant way?
Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
A rather good utility which does this is Speed Ferret by Black Moshannon.
While not free, its cost is probably less than a reasonable rate for your
development times the hours you'll spend on it.
If I recall correctly, it does actually open all your forms & modules, but
it's got some good tricks for keeping them hidden.

HTH
- Turtle

"Jelmer" <jk******@planet.nl> wrote in message
news:c1**********@reader10.wxs.nl...
Hi I've been trying to create an addin similar to Find & Replace from Rick
Fisher that looks thru your tables / queries / forms / modules etc.. for a
reference to a string and optionally let's you replace it.

In order to get this to work I need to get

- the tablenames and columnnames
- the queries in plaintext
- the properties of a form and the properties of elements contained within
it
- the sourcecode in the various vb modules formmodules and classmodules

I found out that for queries and tables this is fairly simple using DAO

However things get's a bit daunting with forms and modules since I can't
seem to find a way to access these objects without opening them

You can reference stuff thru Application.Forms and Application.Modules but
these only contain the currently opened forms / modules and I need *all*
forms

CurrentProject.AllForms lists all forms but returns only AccessObject's
which basicly means I can only get the name of form and if it's been loaded. But I can't reference it without loading it which is well let me say pretty anoying

I know I can do

DoCmd.OpenForm formName, , , , , acHidden

and then later close it, but that seems rather hackish and has some problems
For modules things get even more messy since I don't think you can open a
module in hidden mode, So when I open the form with DoCmd.openModule the vba environment pops up. not very elegant.. to say the least

The only workaround I've found sofar is using the *shrug* undocumented
Application.SaveAsText function to look inside the code , change it on disk and then reeimport it with Application.LoadFromText

Could someone suggest a more elegant way?

Nov 12 '05 #2

P: n/a
Yes I knew about speed ferret before starting this endevour and though I
like it I thought the $199 pricetag was a bit steep. So I decided to write
my own, It shouldn't be too hard afterall right? To me writing this is just
a way of getting reaquainted with access since the last time I used it for
anything serious was eh well quite some time ago. So time spent isn't really
an issue

"MacDermott" <ma********@nospam.com> wrote in message
news:9x******************@newsread1.news.atl.earth link.net...
A rather good utility which does this is Speed Ferret by Black Moshannon.
While not free, its cost is probably less than a reasonable rate for your
development times the hours you'll spend on it.
If I recall correctly, it does actually open all your forms & modules, but
it's got some good tricks for keeping them hidden.

HTH
- Turtle

"Jelmer" <jk******@planet.nl> wrote in message
news:c1**********@reader10.wxs.nl...
Hi I've been trying to create an addin similar to Find & Replace from Rick Fisher that looks thru your tables / queries / forms / modules etc.. for a reference to a string and optionally let's you replace it.

In order to get this to work I need to get

- the tablenames and columnnames
- the queries in plaintext
- the properties of a form and the properties of elements contained within it
- the sourcecode in the various vb modules formmodules and classmodules

I found out that for queries and tables this is fairly simple using DAO

However things get's a bit daunting with forms and modules since I can't
seem to find a way to access these objects without opening them

You can reference stuff thru Application.Forms and Application.Modules but these only contain the currently opened forms / modules and I need *all*
forms

CurrentProject.AllForms lists all forms but returns only AccessObject's
which basicly means I can only get the name of form and if it's been

loaded.
But I can't reference it without loading it which is well let me say

pretty
anoying

I know I can do

DoCmd.OpenForm formName, , , , , acHidden

and then later close it, but that seems rather hackish and has some

problems

For modules things get even more messy since I don't think you can open a module in hidden mode, So when I open the form with DoCmd.openModule the

vba
environment pops up. not very elegant.. to say the least

The only workaround I've found sofar is using the *shrug* undocumented
Application.SaveAsText function to look inside the code , change it on

disk
and then reeimport it with Application.LoadFromText

Could someone suggest a more elegant way?


Nov 12 '05 #3

P: n/a
You might be able to use API calls to hide the window(s) related to
the VBA IDE.

On Wed, 25 Feb 2004 12:08:33 +0100, "Jelmer" <jk******@planet.nl>
wrote:
Yes I knew about speed ferret before starting this endevour and though I
like it I thought the $199 pricetag was a bit steep. So I decided to write
my own, It shouldn't be too hard afterall right? To me writing this is just
a way of getting reaquainted with access since the last time I used it for
anything serious was eh well quite some time ago. So time spent isn't really
an issue

"MacDermott" <ma********@nospam.com> wrote in message
news:9x******************@newsread1.news.atl.eart hlink.net...
A rather good utility which does this is Speed Ferret by Black Moshannon.
While not free, its cost is probably less than a reasonable rate for your
development times the hours you'll spend on it.
If I recall correctly, it does actually open all your forms & modules, but
it's got some good tricks for keeping them hidden.

HTH
- Turtle

"Jelmer" <jk******@planet.nl> wrote in message
news:c1**********@reader10.wxs.nl...
> Hi I've been trying to create an addin similar to Find & Replace fromRick > Fisher that looks thru your tables / queries / forms / modules etc.. fora > reference to a string and optionally let's you replace it.
>
> In order to get this to work I need to get
>
> - the tablenames and columnnames
> - the queries in plaintext
> - the properties of a form and the properties of elements containedwithin > it
> - the sourcecode in the various vb modules formmodules and classmodules
>
> I found out that for queries and tables this is fairly simple using DAO
>
> However things get's a bit daunting with forms and modules since I can't
> seem to find a way to access these objects without opening them
>
> You can reference stuff thru Application.Forms and Application.Modulesbut > these only contain the currently opened forms / modules and I need *all*
> forms
>
> CurrentProject.AllForms lists all forms but returns only AccessObject's
> which basicly means I can only get the name of form and if it's been

loaded.
> But I can't reference it without loading it which is well let me say

pretty
> anoying
>
> I know I can do
>
> DoCmd.OpenForm formName, , , , , acHidden
>
> and then later close it, but that seems rather hackish and has some

problems
>
> For modules things get even more messy since I don't think you can opena > module in hidden mode, So when I open the form with DoCmd.openModule the

vba
> environment pops up. not very elegant.. to say the least
>
> The only workaround I've found sofar is using the *shrug* undocumented
> Application.SaveAsText function to look inside the code , change it on

disk
> and then reeimport it with Application.LoadFromText
>
> Could someone suggest a more elegant way?
>
>



Nov 12 '05 #4

P: n/a
On Wed, 25 Feb 2004 01:47:41 +0100, "Jelmer" <jk******@planet.nl> wrote:
Hi I've been trying to create an addin similar to Find & Replace from Rick
Fisher that looks thru your tables / queries / forms / modules etc.. for a
reference to a string and optionally let's you replace it.

In order to get this to work I need to get

- the tablenames and columnnames
- the queries in plaintext
- the properties of a form and the properties of elements contained within
it
- the sourcecode in the various vb modules formmodules and classmodules
....I know I can do

DoCmd.OpenForm formName, , , , , acHidden

and then later close it, but that seems rather hackish and has some problems
Definitely problematic in that form, but not so bad if you specify design mode
for opening. That is, in fact, what Speed Ferret and other similar tools do
to search forms and reports. If you use design view, then the only issue is
to make sure all forms and reports are closed before you run the code.
For modules things get even more messy since I don't think you can open a
module in hidden mode, So when I open the form with DoCmd.openModule the vba
environment pops up. not very elegant.. to say the least

The only workaround I've found sofar is using the *shrug* undocumented
Application.SaveAsText function to look inside the code , change it on disk
and then reeimport it with Application.LoadFromText

Could someone suggest a more elegant way?


The VBIDE library appears to allow working with modules without opening editor
windows.

Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.