Continuing...
Of course, just after I posted this, and having spent a significant amount
of free time on this, I started thinking... (why wait 'til then to start
thinking, you might ask! <g>)
I know about GetOption/SetOption. Flailing around in the help system, I
stumbled across a reference to the "Application Icon", which led me to
"RefreshTitleBar", which had an example of updating the title bar, which
contained the following:
strAppName = db.Properties!AppTitle
AHA! Well, that works just fine for what I want. But, (if you have had the
strength to stay with me to this point!), I have two questions:
1. Is *this* the better way?
2. Where the *&$! in the help system (Access 2003), can I get a list of the
database properties that lists, for example, "AppTitle"?!
Happily puttering...
Fred
> 2. Where can I get a list of the database properties
In the A97 help, searching for AppTitle leads me to the "Properties
Reference". In A2000, using the help system just makes me frustrated.
So, in the debug window:
for i=0 to codedb.properties.count-1: ?codedb.properties(i).name: next i
This uses the default container (databases) and document (MSysDB). The
complete address would be
CodeDB.Containers("databases").Documents("MSysDb").properties.
The startup properties do not exist if they are not in use. There is no
Apptitle property unless you have defined an AppTitle
> 1. Is *this* the better way?
This is a way. For AppTitle it is a good way. For custom properties, I would
use
CodeDB.Containers("databases").Documents("UserDefined").properties
because you can look at those by going to
File, Database Properties, Custom
Both properties and records get stored in the database: I don't think that
matters much. I think it is more a matter of coding practice. I expect to
find data in a table, so that is always where I first think of putting it.
When I want to show the values at runtime, I just put up a form, bound to
the table. So there are very few cases where the convenience of using custom
database properties is greater than the convenience of using a table. And I
hate to do any kind of lookup in the middle of an error handler, so I always
use Module Level variables there, initialised at startup.
Of course, you can get the app name on the message box automatically after
you set the AppTitle, like this:
eval("msgbox(" & Msg & ", vbExclamation)")
Using Eval forces VBA to use the Access MsgBox (a feature partially broken
in A2K+), instead of the VBA MsgBox. Still, hardly worth it unless you are
already using the other features of the Access MsgBox (bold sections of the
msgbox text).
(david)
> Continuing...
>
[quoted text clipped - 59 lines]
>>
>> End Function
Fred Boer - 18 Jan 2006 23:54 GMT
Dear David:
Thank you for your help! With the help you provided, I was able to get a
list of the properties. I doubt if I will be ever be creating custom
properties, but thanks for the additional information. I had no idea that
there was an Access Messagebox as opposed to the VBA Messagebox, so I think
I'll just let that lie as well! :)
You say:
"And I hate to do any kind of lookup in the middle of an error handler, so I
always use Module Level variables there, initialised at startup."
I think I can understand why it would be bad practice to try to do a lookup
while Access is in the process of dealing with an error, but, if you don't
mind, could you expand on the "module level variables" and how you
initialize them at startup? Do you mean that I could create a public
variable (for example, in code behind my splash form), which I could then
refer to in the error handling code?
Thanks!
Fred
> > 2. Where can I get a list of the database properties
>
[quoted text clipped - 107 lines]
> >>
> >> End Function