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

Hiding a table using VB. Also Registry entries

P: n/a
RWC
Hi!

I'm having a problem in A2K2. This should be simple, but I can't really
figure it out. First problem, I'm trying to set the property of a table,
via Vb to hidden, and I aslo would like to update the Description as well.
For some reason I can't seem to find any reference to doing this in the
online help.

Also, second part; I would like to find out more about reading, adding and
editing a registry entry via Access / VB. Although I haven't exhausted the
online help or knowledge base on this one yet, any help in directing me to a
resource would be great.

Thanks!
RWC.
Nov 12 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
rkc

"RWC" <he********@shaw.ca> wrote in message
news:fB69b.4918$AD1.340@pd7tw2no...
Hi!

I'm having a problem in A2K2. This should be simple, but I can't really
figure it out. First problem, I'm trying to set the property of a table,
via Vb to hidden, and I aslo would like to update the Description as well.
For some reason I can't seem to find any reference to doing this in the
online help.

Also, second part; I would like to find out more about reading, adding and
editing a registry entry via Access / VB. Although I haven't exhausted the online help or knowledge base on this one yet, any help in directing me to a resource would be great.


Never wanted to hide a table via code so I can't answer that one.

An example of retuning a table's Description property follows. The error
handling is necessary because if the description hasn't been set the
property doesn't exist.

<code>
Function TableDescription(tableName As String) As String
On Error GoTo errHandler

TableDescription =
CurrentDb.TableDefs(tableName).Properties("Descrip tion")
Exit Function

errHandler:
TableDescription = ""

End Function
</code>

There are VBA methods to read and write to the registry. Look for
DeleteSetting, GetAllSettings, GetSetting and SaveSetting.

There are also a dozen or so Windows API functions that deal with
the registry. I'm sure they are documented on msdn.microsoft.com.


Nov 12 '05 #2

P: n/a
TC

"RWC" <he********@shaw.ca> wrote in message
news:fB69b.4918$AD1.340@pd7tw2no...
Hi!

I'm having a problem in A2K2. This should be simple, but I can't really
figure it out. First problem, I'm trying to set the property of a table,
via Vb to hidden, and I aslo would like to update the Description as well.
For some reason I can't seem to find any reference to doing this in the
online help.

Also, second part; I would like to find out more about reading, adding and
editing a registry entry via Access / VB. Although I haven't exhausted the online help or knowledge base on this one yet, any help in directing me to a resource would be great.


As the other respondent said, VBA gives you GetSetting, SaveSetting & so on.
These are easy to use, BUT, they put your keys at a fixed location in the
registry. I can't remember where that is (see online help), but I *do*
remember that it is not where I wanted it! So you might not want to use
those functions. (Geez msoft, how hard would it have been to have the extra
parameter! :-(

Try googling on "win32 registry vba" - there's sure to be tons around. But
here's a tip: carefully check the access level that you request on the
registry. In win95 (98? 9x?) it was not checked, & you could get away with
anything. But in winXP etc. it is checked, so code that used to run before,
might start getting permission errors. If you only want to read, just
request read - no more - & so on.

HTH,
TC

Nov 12 '05 #3

P: n/a
rkc

"TC" <a@b.c.d> wrote in message news:1063618288.584568@teuthos...
As the other respondent said, VBA gives you GetSetting, SaveSetting & so on. These are easy to use, BUT, they put your keys at a fixed location in the
registry. I can't remember where that is (see online help), but I *do*
remember that it is not where I wanted it! So you might not want to use
those functions. (Geez msoft, how hard would it have been to have the extra parameter! :-(


I'm not sure it's in the help file, but according to VBA & VBA in a Nutshell
SaveSetting writes to a subkey of

KEY_CURRENT_USER\Software\VB and VBA Program Settings.

Nov 12 '05 #4

P: n/a
TC

"rkc" <rk*@yabba.dabba.do.rochester.rr.com> wrote in message
news:oI*******************@twister.nyroc.rr.com...

"TC" <a@b.c.d> wrote in message news:1063618288.584568@teuthos...
As the other respondent said, VBA gives you GetSetting, SaveSetting & so on.
These are easy to use, BUT, they put your keys at a fixed location in the registry. I can't remember where that is (see online help), but I *do*
remember that it is not where I wanted it! So you might not want to use
those functions. (Geez msoft, how hard would it have been to have the

extra
parameter! :-(


I'm not sure it's in the help file, but according to VBA & VBA in a

Nutshell SaveSetting writes to a subkey of

KEY_CURRENT_USER\Software\VB and VBA Program Settings.


Yes, I remember now. And that's why I don't like it! If you are installing
something that is common to the machine as a whole - not specific to the
current user - you want it to go in HKEY_LOCAL_MACHINE, and this is not
possible when using those functions.

TC

Nov 12 '05 #5

P: n/a
TC

"Max" <ma*********@yahoo.com> wrote in message
news:d7**************************@posting.google.c om...

(snip)
If you want to write and read other registry settings try using win 32
API function like RegCreateKeyEx, RegOpenKeyEx etc.

Yep, I already do that :-)

But thanks for the advice anyway.

TC

Nov 12 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.