By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,089 Members | 2,301 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,089 IT Pros & Developers. It's quick & easy.

Click and hold (need Info)

P: 48
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
Share this Question
Share on Google+
7 Replies


FishVal
Expert 2.5K+
P: 2,653
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.

Regards,
Fish
Apr 17 '08 #2

P: 48
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)
  2.  
  3. 'starttimer
  4. dim timervalue
  5. timervalue='time mouse is pressed and held down
  6. if timervalue>3000
  7. 'openform etc
  8.  
  9. End Sub
  10.  
Apr 18 '08 #3

FishVal
Expert 2.5K+
P: 2,653
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,
Fish
Apr 18 '08 #4

P: 48
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

P: 48
Ps. It is invisible.but its a white image on a white backround. So it should fire
Apr 18 '08 #6

FishVal
Expert 2.5K+
P: 2,653
Ok.

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.

Regards,
Fish
Apr 18 '08 #7

P: 48
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
  4.  
  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
  9.  
Simple but hard if you dont know how lol. thanks again fish for all the valuable pointers
regards
Panteraboy
Apr 24 '08 #8

Post your reply

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