Signing a Database (not digital)

C

Christine Lisi

I would like to sign my database using my name, and I don't want anyone to be
able to modify the signature. Does anyone have any idea how I would
accomplish this. In other words, I would like my name (Created By: Christine
Lisi) to appear on all tables, queries, etc. Kind of like credits.

Thanks.
 
T

Tim Ferguson

I would like to sign my database using my name, and I don't want
anyone to be able to modify the signature. Does anyone have any idea
how I would accomplish this. In other words, I would like my name
(Created By: Christine Lisi) to appear on all tables, queries, etc.
Kind of like credits.

Use a global variable or a public function to return the string you want;
and then use text boxes on the forms with their controlsources set to it.

You can format the text box so it looks like a label. I don't think you can
set the controlsource for a label.Caption to a function or a variable. You
could do it by using the Form_Open event to read it and poke in the value.

Hope that helps


Tim F
 
C

Christine Lisi

Tim - I'm sorry. I'm a beginner and I have no idea what you're talking
about. Can you be more specific or give me step-by-step instructions?

Thanks,
Christine
 
T

Tim Ferguson

Tim - I'm sorry. I'm a beginner and I have no idea what you're
talking about. Can you be more specific or give me step-by-step
instructions?

First of all, you will need a little bit of VBA. Open the VB Editor <alt +
F11>, and Insert a new Code Module, press F4 to open the Properties and
change its name to something meaningful like "MGlobals" (Module for Globals
:) )

You need to type a constant and a function: enter this exactly

Option Explicit

Global Const gc_sMySignature = "Created By: Christine Lisi"
Global Const gc_sLastUpdate As Date = "2005-06-22"


Public Function GetMySig() As Variant
GetMySig = gc_sMySignature
End Function


That's it: you can now use the signature in your forms. One way is to use a
text box, set its properties to Locked=True, Enabled=False, Border=None,
BackColor=Transparent etc. Then set its ControlSource to "=GetMySig()" --
including the equal sign -- and it will look up the function in the module
every time the form is opened. Unfortunately the control cannot see the
Const itself, so you need to get it indirectly using the function.

Another method is to use the form itself to look up the value. On the form,
add a label and name it something like "lblUpdateDate". Then select the
form itself, and find the OnCurrent event, click the ellipsis [...] and
choose the Code Builder. You will find the beginning and end of a
procedure, to which you add the middle vis:

Public Sub Form_Current()
' you type the next line
lblUpdateDate.Caption = "Last Updated: " & gc_sLastUpdate

End Sub



If all goes well, when you open the form your signature should appear in
the text box, and the version date will appear in the label.

Hope that helps


Tim F
 
C

Christine Lisi

Tim: Thanks for the info. I created the Code Module but this does not
accomplish what I need. I want the signature to be applied automatically on
all queries, forms, etc. I don't want to have to manually call for the
signature. You see, once I distribute this database, users will have full
reign to create queries and such. I want my signature to appear
automatically without having to add it to each object. Is this possible?

Tim Ferguson said:
Tim - I'm sorry. I'm a beginner and I have no idea what you're
talking about. Can you be more specific or give me step-by-step
instructions?

First of all, you will need a little bit of VBA. Open the VB Editor <alt +
F11>, and Insert a new Code Module, press F4 to open the Properties and
change its name to something meaningful like "MGlobals" (Module for Globals
:) )

You need to type a constant and a function: enter this exactly

Option Explicit

Global Const gc_sMySignature = "Created By: Christine Lisi"
Global Const gc_sLastUpdate As Date = "2005-06-22"


Public Function GetMySig() As Variant
GetMySig = gc_sMySignature
End Function


That's it: you can now use the signature in your forms. One way is to use a
text box, set its properties to Locked=True, Enabled=False, Border=None,
BackColor=Transparent etc. Then set its ControlSource to "=GetMySig()" --
including the equal sign -- and it will look up the function in the module
every time the form is opened. Unfortunately the control cannot see the
Const itself, so you need to get it indirectly using the function.

Another method is to use the form itself to look up the value. On the form,
add a label and name it something like "lblUpdateDate". Then select the
form itself, and find the OnCurrent event, click the ellipsis [...] and
choose the Code Builder. You will find the beginning and end of a
procedure, to which you add the middle vis:

Public Sub Form_Current()
' you type the next line
lblUpdateDate.Caption = "Last Updated: " & gc_sLastUpdate

End Sub



If all goes well, when you open the form your signature should appear in
the text box, and the version date will appear in the label.

Hope that helps


Tim F
 
T

Tim Ferguson

Is this possible?

No.

If your users are going to be creating forms and reports, then there is not
much left that is "yours" to sign anyway, except for the schema. You
_could_ lock that up, but they would need access to the design
documentation in order to create their own objects.

Since a query consists only of data, there isn't anyplace to put a
signature anyway.

Best of luck.

Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top