473,385 Members | 1,693 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,385 software developers and data experts.

Assigning a Keystroke to a Command Button

Hi All

I'm using Excel and I input numbers into a cell with a scanner. Once I have keyed enter/return, the vb program does a search on this number. I do not want to use the key to 'enter/return' I want to use a command button only.

I have tried -

Private Sub CommandButton1_Click()

SendKeys.Send ("{ENTER}")


End Sub

- but I'm not sure if I have to give other information with this command!

Can anyone help?

Thanks Jon
Jul 13 '07 #1
2 1748
Killer42
8,435 Expert 8TB
Why not simply have the command button trigger whatever it is that the Enter normally triggers?
Jul 13 '07 #2
Cheers for that, thinking the hard way, not for the first time.

Have moved the code to the command button, but the command button will not activate until the active cell with the scanned number is deactive (by this, if I go to an empty cell before the command button it works). Is there a way of deactivating the cell once a number has been inputed by the scanner? Or it brings me back to doing a enter/return.

Anything will be a help. Thanks
Jul 14 '07 #3

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

Similar topics

5
by: gtz669 | last post by:
I have a class which I am using for data stroage. I declare an instance of that class in my main class which is running my java applet. I Iassign it a value in the init () function and it works...
7
by: hokieghal99 | last post by:
Does anyone know of a keystroke logger that has been written in Python for Windows machines? I'd like to see such a script and use it as a point of reference for a real-time backup project that I'm...
7
by: Brian | last post by:
Inside a loop, I need to passively check to see if a key is pressed or not without pausing like raw_input does. Some pseudocode: While true: If a key is pressed which key is pressed do...
2
by: Wayne Wengert | last post by:
I want to get the decimal (integer) value of user keystrokes. I am using the following code. chrInput is the character entered (e.g. "M") and "keystroke is DIMed as Short keystroke =...
1
by: Amin Gunawan via .NET 247 | last post by:
I would like to put a combo box in a column of a datagrid. I've seen the samples in the MSDN library of other sources, butall samples didn't catch the 'DOWN/UP' keystroke. It means thatwhen I select...
1
by: Jenny | last post by:
Hi, Can I create an array of tags by assigning same name to these tags? For example, I have two <p> tags with the same name t1. But document.all.b.value=document.all.t.length does not...
4
by: MLH | last post by:
Tell me if this assignment should return "Invalid use of Null" error: Dim RememberedReportNum AS Long RememberedReportNum = DLookup("", "") While considering your response, here's what the...
0
by: Newbie | last post by:
Dialog blows out upon bad keystroke. Please pardon the Q if it has been asked too frequently, I could not find it. When I hit a bad key in and uneditable control (ie <RTN> when tihe focus is...
4
by: Drisconsult | last post by:
Hello All I am new to VBA. I have just begun converted all my Access macros to VBA. As I understand it they are converted to Modules. How do I assign the converted module to the command button that...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.