469,290 Members | 1,691 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,290 developers. It's quick & easy.

Click and hold (need Info)

Hi again byters. I developed an access 2003 database which contains various different computer, servers, printer etc specifications.(thanks for all the help) The system will be implemented using a touchscreen. The user/ customer will be able to view the different models but will have no previlegies for updating.I have created an invisible small image on the screen that only I can locate and when i touch an hold this for 3 seconds i will have admin access and be able to go to my own personalised forms/queries. The question i have is how to tell this timing information to the click event. Any pointers or help would be appreciated greatly.
Apr 17 '08 #1
7 3835
2,653 Expert 2GB
Hi, there.

Assuming touchscreen causes mouse events, you should something like:
  • In thecontrol_MouseDown event handler set a global variable to True and run form timer
  • In thecontrol_MouseUp event handler reset the global variable to False
  • In Form_Timer event handler check the global variable value and if True, then grant admin access.

Apr 17 '08 #2
Thanks for the help. I still learning the basic syntax of vb for access. Ive got the concept in my head i just lack the experience an knowhow for example I wish to initialise the timer on mousedown event and stop it on mouse up event.Do we use the TimeInterval property?I know this property is measured in milliseconds Or alternatively if the timer on the mousedown event is > 3000 . (3sec)OpenForm/query screen. Below is what i wish to do. My apologies if it is a bit ambiguous Any suggestions

Abstract code for Mousedown event of image

Expand|Select|Wrap|Line Numbers
  1. Private Sub Image30_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  3. 'starttimer
  4. dim timervalue
  5. timervalue='time mouse is pressed and held down
  6. if timervalue>3000
  7. 'openform etc
  9. End Sub
Apr 18 '08 #3
2,653 Expert 2GB
Hi, there.
  • Form.TimerInterval property is used to initialize timer. When value is set timer begins to tick. As soon as predefined time will elapse Form_Timer event will be fired.
  • You code should be in 3 event handlers (see my previous post).
  • Anyway no mouse/touchscreen event will be fired on invisible control.
  • Do you really think that is the safest way to grant admin access to user? Or you've seen that in some movie? ;)

Kind regards,
Apr 18 '08 #4
Thanks again fish lol. Nice to see you have a sense of humour lol. No i was a bit inarticulate previously. The database is set up for customers to browse through a range of products classified by manufacture.
The idea behind the previous posts is that say for example the customer comes in wants a low spec model, with Vista . i press my magic button and display all models with the criteria they want. Its not so much admin more like a backend version.
Apr 18 '08 #5
Ps. It is invisible.but its a white image on a white backround. So it should fire
Apr 18 '08 #6
2,653 Expert 2GB

I don't like to bring bad news but it seems that it will be more complicated then it seemed before.
The problem is that
  • Access suspends code execution (including callbacks from OS) while mouse button is down. That means any useful code has to be in MouseDown event handler.
  • No event will be fired while event handler is active and there is no conventional way to determine mouse button state in running code.

The closest solution is to write code determining how much time mouse button was down on control.

Apr 18 '08 #7
Thanks fish i got her going. I read through what you said again and relalised i had misread the the order in which the events happen. It doesn't fire till you let the mouse up again but it takes the 3 seconds into consideration.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Timer()
  2. DoCmd.OpenForm ("pcspecs2")
  3. Me.TimerInterval = 0
  5. End Sub
  6. Private Sub Image30_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  7. Me.TimerInterval = 3000
  8. End Sub
Simple but hard if you dont know how lol. thanks again fish for all the valuable pointers
Apr 24 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

10 posts views Thread by BadOmen | last post: by
18 posts views Thread by nutso fasst | last post: by
4 posts views Thread by Ian Kelly | last post: by
reply views Thread by botenremko | last post: by
reply views Thread by Paul DeWitt | last post: by
3 posts views Thread by Bazza | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.