473,388 Members | 1,330 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Capturing keystrokes in a ComboBox

222 100+
I'm using MS access 2003...

In my form I have a combo box I need to use on dirty action the following code

DIM X AS StrinG

X=MYCOMBO( my goal is to get every character written on the combo for example if user press A --> x=a after that if user will write S then x=AS )
is keycode function useful !?

It is not working in dirty (it works if it is not a combo box) I don't know why and What I have to do ...

thank you everybody
Apr 17 '07 #1
4 2711
ADezii
8,834 Expert 8TB
I'm using MS access 2003...

In my form I have a combo box I need to use on dirty action the following code

DIM X AS StrinG

X=MYCOMBO( my goal is to get every character written on the combo for example if user press A --> x=a after that if user will write S then x=AS )
is keycode function useful !?

It is not working in dirty (it works if it is not a combo box) I don't know why and What I have to do ...

thank you everybody
To capture individual characters in a Combo Box and increment a String, Declare a String Variable As Static in the Combo's KeyPress() Event. The code is listed below and the entry in the Combo Box was Philadelphia is the City of Brotherly Love! The Output of Debug.Print is also listed:
Expand|Select|Wrap|Line Numbers
  1. Private Sub cboTest_KeyPress(KeyAscii As Integer)
  2. Static X As String
  3.  
  4. X = X & Chr$(KeyAscii)
  5. Debug.Print X
  6. End Sub
OUTPUT:
Expand|Select|Wrap|Line Numbers
  1. P
  2. Ph
  3. Phi
  4. Phil
  5. Phila
  6. Philad
  7. Philade
  8. Philadel
  9. Philadelp
  10. Philadelph
  11. Philadelphi
  12. Philadelphia
  13. Philadelphia 
  14. Philadelphia i
  15. Philadelphia is
  16. Philadelphia is 
  17. Philadelphia is t
  18. Philadelphia is th
  19. Philadelphia is the
  20. Philadelphia is the 
  21. Philadelphia is the C
  22. Philadelphia is the Ci
  23. Philadelphia is the Cit
  24. Philadelphia is the City
  25. Philadelphia is the City 
  26. Philadelphia is the City o
  27. Philadelphia is the City of
  28. Philadelphia is the City of 
  29. Philadelphia is the City of B
  30. Philadelphia is the City of Br
  31. Philadelphia is the City of Bro
  32. Philadelphia is the City of Brot
  33. Philadelphia is the City of Broth
  34. Philadelphia is the City of Brothe
  35. Philadelphia is the City of Brother
  36. Philadelphia is the City of Brotherl
  37. Philadelphia is the City of Brotherly
  38. Philadelphia is the City of Brotherly 
  39. Philadelphia is the City of Brotherly L
  40. Philadelphia is the City of Brotherly Lo
  41. Philadelphia is the City of Brotherly Lov
  42. Philadelphia is the City of Brotherly Love
  43. Philadelphia is the City of Brotherly Love!
Apr 18 '07 #2
wassimdaccache
222 100+
Thank you it worked " I LIKE THIS SIT AND UR BRAIN GUYS :)"
Apr 18 '07 #3
ADezii
8,834 Expert 8TB
Thank you it worked " I LIKE THIS SIT AND UR BRAIN GUYS :)"
Glad to help.
Apr 18 '07 #4
NeoPa
32,556 Expert Mod 16PB
Please remember to provide a meaningful Title for any threads started (Please Use Appropriate Titles for New Threads!). This helps to ensure that other members, and also the general public, will have a better chance of finding answers to any similar questions.

MODERATOR.

I've changed the title of this thread for you.
Apr 19 '07 #5

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

Similar topics

5
by: Bilal | last post by:
Hi, Is there any way to capture the action Ctrl+N (whether it in a hidden button or keyword - doesn't matter) in html, javascript or php? I appreciate any suggestions. Thank you and kind regards...
2
by: Olli Piepponen | last post by:
Hi, I'm having a little problem catching keystrokes under Windows. I did a little research and found that with mscvrt.getch() one can cath a single key that is pressed. However this doesn't work...
33
by: Joerg Schuster | last post by:
Hello, Python regular expressions must not have more than 100 capturing groups. The source code responsible for this reads as follows: # XXX: <fl> get rid of this limitation! if...
2
by: Randy | last post by:
I have a DataTable in a DataGrid on a Windows form. I have comboboxes in the first column, and that seems to work just fine. The second column is for a money amount. The numeric dollar value...
1
by: Pjotr Wedersteers | last post by:
Hi I want to write a small prog/applet that does nothing but the following: Display icons representing the keys pressed on the keyboard in a small "always on top" but transparent window. The...
1
by: Rob T | last post by:
In the past, I've made several poor attempts at capturing keyboard strokes with JS. Mostly, I would want to hit something like ALT-H or F1 for a help screen.... Hitting the Alt key usually...
5
by: Lucas Tam | last post by:
Hi all, Has anyone done this before? Send client side keystrokes to an application from a webpapge? This maybe more of a Javascript question. In short, I have an application on the client's...
14
by: @sh | last post by:
Has anyone a function handy that I can apply to various textboxes within a form, each textbox will permit most characters but I want to ban certain characters from each textbox. Therefore I need...
3
by: Gunnar Syren | last post by:
I'm trying to implement a macro feature in my application by recording and playing back keystrokes. At first I thought it would be enough to catch KeyDown in my main form, but I soon realized that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.