Startup Form Option

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form on startup, displaying a disclaimer message along with three
options: one to continue to the main switchboard, one to exit access, and
hopefully one like the HideStartupForm control in the "Northwind Traders"
sample database. The problem with the sample database is that the option
goes into the startup settings and changes the form startup. This is good,
but I have several users and I'd like to give all users this option. My idea
was to create a table (2 fields, User and HideStartup(Yes/No)) that "logs"
you in and records your selection. And in the On Open event of the startup
form, I'd like Access to go to the record containing the current user check
the HideStartup Field, and depending on the selection go to the main
switchboard or stay in the startup form. Does anyone know the code to go to
a record and check for that option, my current code is:

Private Sub Form_Open(Cancel As Integer)
On Error GoTo Startup_err

[Input Record Selecting Command Here]

If HideStartup Then
DoCmd.Close
DoCmd.OpenForm "Switchboard"
Else
Exit Sub
End If

Startup_err:
Exit Sub

End Sub

Is this the best way to do this, or is there a better way?
 
Neil said:
I have a form on startup, displaying a disclaimer message along with three
options: one to continue to the main switchboard, one to exit access, and
hopefully one like the HideStartupForm control in the "Northwind Traders"
sample database. The problem with the sample database is that the option
goes into the startup settings and changes the form startup. This is good,
but I have several users and I'd like to give all users this option. My idea
was to create a table (2 fields, User and HideStartup(Yes/No)) that "logs"
you in and records your selection. And in the On Open event of the startup
form, I'd like Access to go to the record containing the current user check
the HideStartup Field, and depending on the selection go to the main
switchboard or stay in the startup form. Does anyone know the code to go to
a record and check for that option, my current code is:

Private Sub Form_Open(Cancel As Integer)
On Error GoTo Startup_err

[Input Record Selecting Command Here]

If HideStartup Then
DoCmd.Close
DoCmd.OpenForm "Switchboard"
Else
Exit Sub
End If

Startup_err:
Exit Sub

End Sub

Is this the best way to do this, or is there a better way?


Since you mention "several users" and setting the Startup
settings changes it for all users, I conclude that you have
not split your database into a front end MDB (all the
queries, forms, Reports, etc) and a back end MDB with the
data tables. You need to seriously consider this split for
many reasons, one of which is that when each user has their
own copy of the front end on their local disk, you wouldn't
be having this problem. A major reason to split are that
you can develop new/changed forms/reports/etc and install
the changes without messing with the data tables. Another
is that it is notoriously unreliable to have multiple copies
of the same file open at the same time. This is a very
important concept that almost all professional Access
developers adhere to for every application. See Tony's site
for more info:
http://www.granite.ab.ca/access/splitapp/index.htm

As for your specific question, you can use the DLookup
function to retrieve the hide startup value from the table:
DLookup("HideStartup", "thetable", "User=""" & who & """"

I have no idea how you determine who the user is, so I can't
be specific about that part. If you're using Access
Security, it could be as simple as Application.CurrentUser
 
I had worked around my initial question and got it to work without having to
split the database. But I've looked into splitting the database, and by the
general recommendation of everyone, have split my database. I haven't
released the database into my company as of yet (Just finished design phase),
and I have A LOT of questions about database splitting that you hopefully
woulnd't mind answering. One of major concerns is that I read somewhere that
when splitting a database, it is advised not to have a set database password.
This is crucial, my database is set up with user and group permissions and
needs to be set up that way. What effect would passwords have on a split
database? Right now I also have it on a company networked drive. I may be
mistaken, but it sounds like the front end can be customized for each
individual user and saved in their own designated destination. Is this
correct? Because I'm the ONLY person who knows how to use Access with some
base skills, and I set up the database so that the average user can use it
without knowledge of Access. Would it be better to have everyone access one
FE file, or should there me multiple? And if so, is there a way to carry on
group permissions to the copied FE's? Should the BE be put in a secret spot
or hidden from view, or will group permissions carry over for split databases
on BE tables and relationships? I have a few others, but I really don't want
to bombard you with questions like this. I completely understand if you
choose not to answer this reply due to the volume, but if you wouldn't mind
it'd be greatly appreciated. Thank you for your advice, I definitely was
unaware of this.

Neil Cash
 
Neil said:
I had worked around my initial question and got it to work without having to
split the database. But I've looked into splitting the database, and by the
general recommendation of everyone, have split my database. I haven't
released the database into my company as of yet (Just finished design phase),
and I have A LOT of questions about database splitting that you hopefully
woulnd't mind answering. One of major concerns is that I read somewhere that
when splitting a database, it is advised not to have a set database password.
This is crucial, my database is set up with user and group permissions and
needs to be set up that way. What effect would passwords have on a split
database? Right now I also have it on a company networked drive. I may be
mistaken, but it sounds like the front end can be customized for each
individual user and saved in their own designated destination. Is this
correct? Because I'm the ONLY person who knows how to use Access with some
base skills, and I set up the database so that the average user can use it
without knowledge of Access. Would it be better to have everyone access one
FE file, or should there me multiple? And if so, is there a way to carry on
group permissions to the copied FE's? Should the BE be put in a secret spot
or hidden from view, or will group permissions carry over for split databases
on BE tables and relationships? I have a few others, but I really don't want
to bombard you with questions like this. I completely understand if you
choose not to answer this reply due to the volume, but if you wouldn't mind
it'd be greatly appreciated. Thank you for your advice, I definitely was
unaware of this.


I don't mind answering, but I have not used Access Security
enough to provide useful answers. Some additional thoughts
for you to pursue before posting a more detailed question to
a new thread in the appropriate newsgroup.

First, it is important that each user have their own copy of
the front end MDB file. Access does too many things behind
the scenes for multiple instances of the same file to be
running at the same time. (And Yes, the back end should be
placed in your application's own directory on a file
server.)

Second, you must find and read (VERY CAREFULLY) the MS
Access security white paper that explains all the detailed
steps that are required to properly set it up. If you do
that, you will understand about creating a new workgroup
file that must be used by everyone to open the database.
This is how your groups/users/passwords are related to the
front end. The back end is trickier so read up on the issue
to get a grasp on User and Owner Permissions, etc.
 
Thanks, I read up on the seqfaq and it seems like I should be fine with user
permissions. But I do have a question. What's the difference between
splitting a database and having a design master/replication?
 
Neil said:
Thanks, I read up on the seqfaq and it seems like I should be fine with user
permissions. But I do have a question. What's the difference between
splitting a database and having a design master/replication?

Two totally separate issues.

Don't confuse replication of data records for distribution
of code changes. Even if the concepts sounds similar,
replication of your front end objects will not work.

The only practical way to distribute form, report and code
changes is to copy your (well tested) development version to
each user's local storage. In most situations this is
nothing more than a simple file copy (unless you introduce
the use of ActiveX controls or additional libraries).

To make this a simple drag and drop operation, I first place
a copy of my new version on the file server where each
user's machine can get to it. To prevent this copy from
being executed, I add code to the startup form's Open event
that checks if the back end and the front end are on the
same drive and, if they are, pop up a nasty message before
aborting.

There are ways of automating a lot of these routine front
end update actions. Tony Toews has a good one at:
http://www.granite.ab.ca/access/autofe.htm
 
Thanks for the information and the link. The Auto Updater sounds very handy,
hopefully I'll be able to get that up and running.
 
Back
Top