Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 2nd, 2007, 08:33 AM
Authorized User
 
Join Date: Jun 2007
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default 2 People viewing same query

I am looking to be able to have a pop up box on a form, so that when another user goes into the same job number they know its allready open by someone else.

Currently I have a table called tblSession this inputs the UserName, JobNumber and DateTime everytime a user goes into any job number, once they come out of that job their details are deleted from the table. How do I write some code so that it tell the user via pop up box that User X is already in this job?

I know that in excel I would do a lookup to the reference table, but just not sure in access.

Thanks,
Jez


 
Old August 3rd, 2007, 12:31 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Control all access to the data in question so that it is through from's you have written.
Create a public counting variable in a module.
Any time the form opens, increment the variable.
If before the increment it is > 0, or after the increment it is > 1, display your message.
In the close/unload event of the form, decrement the variable.
 
Old August 6th, 2007, 04:46 AM
Authorized User
 
Join Date: Jun 2007
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the reply, but dont really understand what you mean, could you explain a bit more please.
Jez

 
Old August 6th, 2007, 11:39 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Take the job number from the form, then look it up in the table. If it is there, then close the job form and pop up a message.

How are they opening the job form? This is the same process that puts the job number in the session table. Do they select a job number and click a button? If so, this is easy.

Please post more details.

mmcdonal
 
Old August 8th, 2007, 09:40 AM
Authorized User
 
Join Date: Jul 2007
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to vksingh24
Default

To solve your problem you can try this approach

1) Create a columns called "STATUS" in the table where you insert your job details

2) When a user open a particular jobno, set the status to "OPEN"

3) When a user try to open a particular job, check the status of the job. If its "OPEN" display a message that the job is open.

__________________
Vikash Kumar Singh
 
Old August 8th, 2007, 10:17 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Would there be record locking issues with this solution? One user has it open and locked and another is trying to take information from it? Or would that only be a write issue? I like this solution. Just add a WHERE clause to your open statement to prevent the form opening. And add an event On Open to check for records and pop up a message and go back to the originating form.


mmcdonal
 
Old August 8th, 2007, 10:44 AM
Authorized User
 
Join Date: Jul 2007
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to vksingh24
Default

There will be no Locking issue.

It depends what you want to do, when one user has open the record(JOB), what the application want, to display a message or let him read only access to the record.

__________________
Vikash Kumar Singh





Similar Threads
Thread Thread Starter Forum Replies Last Post
I need some help from you people vbpratap VB How-To 2 March 3rd, 2006 08:18 PM
Please Help Me Dear People. InsouciantCoquette Classic ASP Databases 10 January 24th, 2006 11:06 PM
How many People are using this as a base Mykre BOOK: ASP.NET Website Programming Problem-Design-Solution 3 October 17th, 2004 04:09 AM
Planoie and People Help ! augustine General .NET 2 July 28th, 2004 09:04 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.