Many Instances

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

Guest

I have created a small database in access using VBA. My next step is to
install this for about 10 users, so they all can use this to run their
reports.

Data in the database is from importing many excel files. I have to refresh
this database once a day. After which all the pther users can run their
reports.

We all have a common drive that we use. So i am assuming that i just move
this database there. But,

I would like to supress the import button from all the users wxcept for 2 of
them. How will i do this when the database is in a commom drive?

How can i make sure that 2 pepole are not editing at the same time?

Thanks
 
Check out the Access help for getting the username for the current user. You
can then use this code to determine who is currently using the db and make
your decision based on that.

Also in the Access help, you will find information about record locking. Use
the option that best suits your needs.

Have you split your db into frontend/backend?
I'd recommend you do this if you have multiple concurrent users...

Steve
 
I have created a small database in access using VBA. My next step is to
install this for about 10 users, so they all can use this to run their
reports.

Data in the database is from importing many excel files. I have to refresh
this database once a day. After which all the pther users can run their
reports.

We all have a common drive that we use. So i am assuming that i just move
this database there. But,

Unless you've implemented User Level Security, CurrentUser always returns "Admin". You could grab the Windows username
and use that, see the link below for code:

http://www.mvps.org/access/api/api0008.htm

Once you determine the username, you can then enable/disable your button like this:

Me.YourButton.Enabled = (apiGetUserName="Fred")
I would like to supress the import button from all the users wxcept for 2 of
them. How will i do this when the database is in a commom drive?

How can i make sure that 2 pepole are not editing at the same time?

It can be tough to make sure that 2 people aren't editing the same record. Record lock settings will help some, but in
many cases this gives an error too late to be of any use (and often the error message is so cryptic users will just
click any button to get out of it). You can add a "flag" boolean field to your table and set that to True whenever
someone attempts to edit a record ... then everytime a user attempts to edit a record, you can check that field and, if
true, alert the user and disallow edits ... of course this can be troublesome if a user quits abruptly (i.e. hits the
power button, or loses network connectivity, etc) since this will leave the flag field set to True even if no one is
editing the record. In general, splitting the db as Steve recommended will solve most of your edit problems, and if you
find that you have record lock issues regularly, you might need to do a little user training.

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 
Thanks for the info. do i use this code in the open form(main menu) event???

Me.YourButton.Enabled = (apiGetUserName="Fred")

and here do i use the code to get the username...

I know there is a event when you open up a application it will run this
first. (AutoExec). Can i use the code from your link here??

If i use the code in autoexec, then how and where do i use
"Me.YourButton.Enabled = (apiGetUserName="Fred")"

Any help on this is greatly appreciated
Thanks a lot again for your help in this.
 
Back
Top