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

Losing Focus

I have an Access application that I have created that collects data
from a scanner and from a weighting scale. The data from the scanner
are unique identifiers (barcodes) and the scanner is connected as a
keyboard wedge. The data from the scale are weights and are
collected
by com port using MScomm32.ocx.

A user will scan a barcode into a text box (linked to a table field)
and then weight a sample. The weight will be collected from the com
port and directly updated to the table. To insure the user that the
weight was successfully captured, I have included a listbox which
queries the table after each scale recording. This way the user can
see their data show up on the screen in a mock spreadsheet.
My problem is that about 1 in 100 barcode scans do not completely
read. I have traced this error to the requerying of the listbox
control. If a barcode is being read in at the same time as the
listbox is being updated, there is a slight chance of the text box
(in
which the barcode is being entered) losing focus for a split second.
Since the computer sees the scanner as a keyboard wedge, it sends the
data to whatever has focus. When the text box loses focus, I lose
part of the barcode.
Is there a way to maintain focus on the text box no matter what
background processes are running? Or better yet is there a better
way
to run a query that doesn't take focus away from foreground
processes?
Thanks.

Feb 21 '07 #1
5 5247
LabGeek wrote:
A user will scan a barcode into a text box (linked to a table field)
<snip>
Is there a way to maintain focus on the text box no matter what
background processes are running? Or better yet is there a better
way
to run a query that doesn't take focus away from foreground
processes?
If you're inputting two things at once, then you run the risk of the
problem you describe. What about not requerying the list box control
except as the after update event of the text box that receives the scan?
You may have to change your interface on the form so that the user
knows s/he should weigh the sample first and then scan the bar code.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
Feb 21 '07 #2
On Feb 21, 12:03 pm, Tim Marshall
<TIM...@PurplePandaChasers.Moertheriumwrote:
LabGeek wrote:
A user will scan a barcode into a text box (linked to a table field)
<snip>
Is there a way to maintain focus on the text box no matter what
background processes are running? Or better yet is there a better
way
to run a query that doesn't take focus away from foreground
processes?

If you're inputting two things at once, then you run the risk of the
problem you describe. What about not requerying the list box control
except as the after update event of the text box that receives the scan?
You may have to change your interface on the form so that the user
knows s/he should weigh the sample first and then scan the bar code.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
Tim,

Thanks for the reply. There are two users in this process. One is
scanning the barcode and taking another measurement which is being
"picked" off a list of barcodes adn the second person is weighting.
The way it is set up, both operators can run independantly of each
other as long as 1) there has been a barcode scanned in for the
record, and 2)they keep the samples in order. This way, person one
can scan multiple samples and be ahead of person two who is doing the
weighting. The scale sends the data to the record with the oldest
timestamp that doesn't have a weight and then updates the screen
(list). This was neither person has to wait for a sample to be
totally completed before starting the next one.

When things are timed just right I have no problems, but when the
people taking the measurements get just out of synch (or are operating
fast) then I get the chance of the list box running a query at the
same time the scaner is reading a bar code. When this happens, there
is the smallest window of time when the text box loses focus and we
lose some of the scanned barcode.

I have tried adding conditions such as "don't query if the text box <>
"" " but this seems to confuse people when the hear the scale beep but
the screen hasn't updated to show the weight has sucessfully taken.

Feb 21 '07 #3
is the listbox locked ? or disabled ? wouldn't that prevent it from
getting focus ?

how is the listbox updated ? a timer event ?
On Feb 21, 2:37 pm, "LabGeek" <tlbr...@monsanto.comwrote:
On Feb 21, 12:03 pm, Tim Marshall

<TIM...@PurplePandaChasers.Moertheriumwrote:
LabGeek wrote:
A user will scan a barcode into a text box (linked to a table field)
<snip>
Is there a way to maintain focus on the text box no matter what
background processes are running? Or better yet is there a better
way
to run a query that doesn't take focus away from foreground
processes?
If you're inputting two things at once, then you run the risk of the
problem you describe. What about not requerying the list box control
except as the after update event of the text box that receives the scan?
You may have to change your interface on the form so that the user
knows s/he should weigh the sample first and then scan the bar code.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me

Tim,

Thanks for the reply. There are two users in this process. One is
scanning the barcode and taking another measurement which is being
"picked" off a list of barcodes adn the second person is weighting.
The way it is set up, both operators can run independantly of each
other as long as 1) there has been a barcode scanned in for the
record, and 2)they keep the samples in order. This way, person one
can scan multiple samples and be ahead of person two who is doing the
weighting. The scale sends the data to the record with the oldest
timestamp that doesn't have a weight and then updates the screen
(list). This was neither person has to wait for a sample to be
totally completed before starting the next one.

When things are timed just right I have no problems, but when the
people taking the measurements get just out of synch (or are operating
fast) then I get the chance of the list box running a query at the
same time the scaner is reading a bar code. When this happens, there
is the smallest window of time when the text box loses focus and we
lose some of the scanned barcode.

I have tried adding conditions such as "don't query if the text box <>
"" " but this seems to confuse people when the hear the scale beep but
the screen hasn't updated to show the weight has sucessfully taken.- Hide quoted text -

- Show quoted text -

Feb 21 '07 #4
On Feb 21, 4:05 pm, lesperan...@natpro.com wrote:
is the listbox locked ? or disabled ? wouldn't that prevent it from
getting focus ?

how is the listbox updated ? a timer event ?

On Feb 21, 2:37 pm, "LabGeek" <tlbr...@monsanto.comwrote:
On Feb 21, 12:03 pm, Tim Marshall
<TIM...@PurplePandaChasers.Moertheriumwrote:
LabGeek wrote:
A user will scan a barcode into a text box (linked to a table field)
<snip>
Is there a way to maintain focus on the text box no matter what
background processes are running? Or better yet is there a better
way
to run a query that doesn't take focus away from foreground
processes?
If you're inputting two things at once, then you run the risk of the
problem you describe. What about not requerying the list box control
except as the after update event of the text box that receives the scan?
You may have to change your interface on the form so that the user
knows s/he should weigh the sample first and then scan the bar code.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
Tim,
Thanks for the reply. There are two users in this process. One is
scanning the barcode and taking another measurement which is being
"picked" off a list of barcodes adn the second person is weighting.
The way it is set up, both operators can run independantly of each
other as long as 1) there has been a barcode scanned in for the
record, and 2)they keep the samples in order. This way, person one
can scan multiple samples and be ahead of person two who is doing the
weighting. The scale sends the data to the record with the oldest
timestamp that doesn't have a weight and then updates the screen
(list). This was neither person has to wait for a sample to be
totally completed before starting the next one.
When things are timed just right I have no problems, but when the
people taking the measurements get just out of synch (or are operating
fast) then I get the chance of the list box running a query at the
same time the scaner is reading a bar code. When this happens, there
is the smallest window of time when the text box loses focus and we
lose some of the scanned barcode.
I have tried adding conditions such as "don't query if the text box <>
"" " but this seems to confuse people when the hear the scale beep but
the screen hasn't updated to show the weight has sucessfully taken.- Hide quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -
There are 5 basic contols on the form. 2 bound text boxes for
scanning in a barcode and a measurement, a text box for displaying
data from a scale, a graph for creating time course representation and
a list box to display all the data that will fit (this is so the users
can monitor the previous several records. The list box and graph are
fed from querys that are run each time there is a Form_update event.
The text boxes are not locked to allow data to be scanned directly
into them. The weight values that are shown on the screen are read
from the table after the com event records them from the scale.

Each time the scale records data, I must requery the table to place
the weight on the screen to "prove" to the user that the value has
been recorded. Sometimes during that query, a second user will scan a
barcode into the unlocked, bound text box (which creates a new record)
and there is a short interval that the text box loses focus and drops
characters.

Thank for the reply!

Feb 21 '07 #5
Are you sure that the textbox has lost focus... or is Access still
processing the form's
after_update() event ?

what happens if you move the requerying of the list box from the
after_update() event to the timer() event ?

are the listbox and graph controls enabled ? is so, why can't they be
disabled so that they can't get focus ?
On Feb 21, 3:49 pm, "LabGeek" <tlbr...@monsanto.comwrote:
On Feb 21, 4:05 pm, lesperan...@natpro.com wrote:


is the listbox locked ? or disabled ? wouldn't that prevent it from
getting focus ?
how is the listbox updated ? a timer event ?
On Feb 21, 2:37 pm, "LabGeek" <tlbr...@monsanto.comwrote:
On Feb 21, 12:03 pm, Tim Marshall
<TIM...@PurplePandaChasers.Moertheriumwrote:
LabGeek wrote:
A user will scan a barcode into a text box (linked to a table field)
<snip>
Is there a way to maintain focus on the text box no matter what
background processes are running? Or better yet is there a better
way
to run a query that doesn't take focus away from foreground
processes?
If you're inputting two things at once, then you run the risk of the
problem you describe. What about not requerying the list box control
except as the after update event of the text box that receives the scan?
You may have to change your interface on the form so that the user
knows s/he should weigh the sample first and then scan the bar code.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
Tim,
Thanks for the reply. There are two users in this process. One is
scanning the barcode and taking another measurement which is being
"picked" off a list of barcodes adn the second person is weighting.
The way it is set up, both operators can run independantly of each
other as long as 1) there has been a barcode scanned in for the
record, and 2)they keep the samples in order. This way, person one
can scan multiple samples and be ahead of person two who is doing the
weighting. The scale sends the data to the record with the oldest
timestamp that doesn't have a weight and then updates the screen
(list). This was neither person has to wait for a sample to be
totally completed before starting the next one.
When things are timed just right I have no problems, but when the
people taking the measurements get just out of synch (or are operating
fast) then I get the chance of the list box running a query at the
same time the scaner is reading a bar code. When this happens, there
is the smallest window of time when the text box loses focus and we
lose some of the scanned barcode.
I have tried adding conditions such as "don't query if the text box <>
"" " but this seems to confuse people when the hear the scale beep but
the screen hasn't updated to show the weight has sucessfully taken.- Hide quoted text -
- Show quoted text -- Hide quoted text -
- Show quoted text -

There are 5 basic contols on the form. 2 bound text boxes for
scanning in a barcode and a measurement, a text box for displaying
data from a scale, a graph for creating time course representation and
a list box to display all the data that will fit (this is so the users
can monitor the previous several records. The list box and graph are
fed from querys that are run each time there is a Form_update event.
The text boxes are not locked to allow data to be scanned directly
into them. The weight values that are shown on the screen are read
from the table after the com event records them from the scale.

Each time the scale records data, I must requery the table to place
the weight on the screen to "prove" to the user that the value has
been recorded. Sometimes during that query, a second user will scan a
barcode into the unlocked, bound text box (which creates a new record)
and there is a short interval that the text box loses focus and drops
characters.

Thank for the reply!- Hide quoted text -

- Show quoted text -

Feb 22 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Morten Wennevik | last post by:
I'm pretty sure this has been mentioned a few times, but so far I haven't found anything. I am trying to "lock" a program to always focus, non closable etc, but overriding OnDeactivate and...
86
by: Michael Adams | last post by:
I don't know if you have noticed, but it seems like Microsoft is losing interest in C#, and putting their energy into Visual Basic.NET instead. For instance, online chats by language since July...
1
by: DomGo | last post by:
Hi, I try to open a form, that automatically loses focus to the window, that had the focus immediatly before the new form has been opened. The new form is topmost and displays a message only for...
0
by: Stefan De Schepper | last post by:
Dear NG, I created a gridlike usercontrol. When clicking on a cell a textbox (or other control, depending on the cell's editortype) is shown. When some other control gets the focus, the textbox...
3
by: Chris | last post by:
I have a form that calls ShowDialog on a number of different forms at different times. I want to be able to know anytime the form loses focus. But Form.Focused isn't ever true once a control has...
1
by: Israel | last post by:
The problem: I want to know, definitively when a slider loses focus after a user has started sliding and hasn't released the mouse yet. It appears that this is captured with the WM_ACTIVATEAPP...
3
by: Patrick [MSFT] | last post by:
Let me preface this with the goal I'm trying to achieve is mimic a feature of another language (Dexterity used by Microsoft Dynamics) and so while a filling a drop down list is a workable solution...
0
by: euthymos | last post by:
Dear developers, I'm developing an application which uses MSWord Interop interface. When my application launches MSWord, my application itself loses the focus (even if MSWord is not visible). ...
25
bugboy
by: bugboy | last post by:
I'm trying to find a cross browser solution for editing text in a flickr photo caption manor where the text is displayed in a <div> or <a> tag but changes to a <textarea> via JS when clicked. ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.