473,698 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Capturing keystrokes in a ComboBox

222 New Member
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 2741
ADezii
8,834 Recognized Expert Expert
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 New Member
Thank you it worked " I LIKE THIS SIT AND UR BRAIN GUYS :)"
Apr 18 '07 #3
ADezii
8,834 Recognized Expert Expert
Thank you it worked " I LIKE THIS SIT AND UR BRAIN GUYS :)"
Glad to help.
Apr 18 '07 #4
NeoPa
32,569 Recognized Expert Moderator MVP
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
2457
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 Bils
2
4986
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 when the program is run on the backround and not as the primary task. What I would like to have is a same sort of function that would also work when the program is being run on the background. I'm trying to implement a program that would listen...
33
5612
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 p.pattern.groups > 100: raise AssertionError( "sorry, but this version only supports 100 named groups"
2
1408
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 doesn't get saved to the cell until I hit <Enter> or tab to the next cell. I'd really like to be able to detect each keystroke in the cell, so it would be just like an Excel spreadsheet. I'd settle for the ability to save whatever numbers are in...
1
2580
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 keys must always be read - even when the proggy has no focus- but not erased from the keyboard buffer so the active app still catches them. I don't want you to do the work for me, but some good pointers or tips would be very nice! I am a novice+...
1
1505
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 kicks you into the IE menu and doesn't really allow me to trap the keystrokes. So....on our new Exchange 2003 web interface, MS has a great interface with it. It allows you to hit ALT-S for send, F7 for spell check, and other strokes that a...
5
2724
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 desktop that needs to communicate with an ASP.NET application. The only interface into the application are keystrokes and DDE.
14
1764
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 a function that I can put into the <text area> tag of each box, something like... <text area onKeyPress="BanCharacters('a','<','>','b','u','i');"> Is this possible easily?
3
5049
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 I needed to catch keystrokes in menues and other forms in my app as well. I realize I can implement a keyboard hook that catches keystrokes globally, but I only want the keystrokes that are sent to my application. Any suggestions on how to...
0
8609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7739
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.