AfterUpdate code to achieve zero value in SubForm textbox

P

Pete

In a SubForm, afterupdate of the [BarCode] I want the textbox[ThisSale] to
have a zero value, but cannot make this happen. I have tried:
ThisSale.value = 0 and simply ThisSale = 0 , but the value of zero does
not appear. Is there something obvious I am missing? It continues to have the
value of a previous sale. Both the BarCode and ThisSale are in the SubForm.
Thanks
 
S

Stuart McCall

Pete said:
In a SubForm, afterupdate of the [BarCode] I want the textbox[ThisSale]
to
have a zero value, but cannot make this happen. I have tried:
ThisSale.value = 0 and simply ThisSale = 0 , but the value of zero
does
not appear. Is there something obvious I am missing? It continues to have
the
value of a previous sale. Both the BarCode and ThisSale are in the
SubForm.
Thanks

Take a look at the Format property of the textbox. If there's a format
pattern there, remove it and re-try the form.
 
P

Pete

I removed the (fixed) format from the text box [ThisSale], but on update of
the [Barcode] the value of [ThisSale] still equates with the previous sale
and does not equate with zero. You say 'retry the Form' - is there
something I should be doing with the Form? I have been working on the two
textboxes within the SubForm. Sorry if I am slow to understand.

Stuart McCall said:
Pete said:
In a SubForm, afterupdate of the [BarCode] I want the textbox[ThisSale]
to
have a zero value, but cannot make this happen. I have tried:
ThisSale.value = 0 and simply ThisSale = 0 , but the value of zero
does
not appear. Is there something obvious I am missing? It continues to have
the
value of a previous sale. Both the BarCode and ThisSale are in the
SubForm.
Thanks

Take a look at the Format property of the textbox. If there's a format
pattern there, remove it and re-try the form.
 
P

Pete

I now note that when the [Barcode] is put in manually and the Enter key
pressed the Textbox value for [ThisSale] does change to Zero on update of the
Barcode. However, the whole object is to use a scanner. Nevertheless, does
this give a clue as to how the problem may be resolved?

Pete said:
I removed the (fixed) format from the text box [ThisSale], but on update of
the [Barcode] the value of [ThisSale] still equates with the previous sale
and does not equate with zero. You say 'retry the Form' - is there
something I should be doing with the Form? I have been working on the two
textboxes within the SubForm. Sorry if I am slow to understand.

Stuart McCall said:
Pete said:
In a SubForm, afterupdate of the [BarCode] I want the textbox[ThisSale]
to
have a zero value, but cannot make this happen. I have tried:
ThisSale.value = 0 and simply ThisSale = 0 , but the value of zero
does
not appear. Is there something obvious I am missing? It continues to have
the
value of a previous sale. Both the BarCode and ThisSale are in the
SubForm.
Thanks

Take a look at the Format property of the textbox. If there's a format
pattern there, remove it and re-try the form.
 
S

Stuart McCall

Answers inline:

Pete said:
I now note that when the [Barcode] is put in manually and the Enter key
pressed the Textbox value for [ThisSale] does change to Zero on update of
the
Barcode. However, the whole object is to use a scanner. Nevertheless, does
this give a clue as to how the problem may be resolved?

Well if you intend to use a 'wedge' scanner (ie one that sits between the
keyboard and the PC) then your problems are over. The scanner simply
'presses the keys' just as if a human had done it.
Pete said:
I removed the (fixed) format from the text box [ThisSale], but on update
of
the [Barcode] the value of [ThisSale] still equates with the previous
sale
and does not equate with zero. You say 'retry the Form' - is there
something I should be doing with the Form? I have been working on the two
textboxes within the SubForm. Sorry if I am slow to understand.

All I meant by 'retry the Form' was to run the form as the user would
normally.
Stuart McCall said:
In a SubForm, afterupdate of the [BarCode] I want the
textbox[ThisSale]
to
have a zero value, but cannot make this happen. I have tried:
ThisSale.value = 0 and simply ThisSale = 0 , but the value of
zero
does
not appear. Is there something obvious I am missing? It continues to
have
the
value of a previous sale. Both the BarCode and ThisSale are in the
SubForm.
Thanks

Take a look at the Format property of the textbox. If there's a format
pattern there, remove it and re-try the form.
 
P

Pete

It will be a couple of days before the coding can be tested with a scanner,
so thanks for the moment, and I will report later as to the resolution of the
problem in practice.

Stuart McCall said:
Answers inline:

Pete said:
I now note that when the [Barcode] is put in manually and the Enter key
pressed the Textbox value for [ThisSale] does change to Zero on update of
the
Barcode. However, the whole object is to use a scanner. Nevertheless, does
this give a clue as to how the problem may be resolved?

Well if you intend to use a 'wedge' scanner (ie one that sits between the
keyboard and the PC) then your problems are over. The scanner simply
'presses the keys' just as if a human had done it.
Pete said:
I removed the (fixed) format from the text box [ThisSale], but on update
of
the [Barcode] the value of [ThisSale] still equates with the previous
sale
and does not equate with zero. You say 'retry the Form' - is there
something I should be doing with the Form? I have been working on the two
textboxes within the SubForm. Sorry if I am slow to understand.

All I meant by 'retry the Form' was to run the form as the user would
normally.
:

In a SubForm, afterupdate of the [BarCode] I want the
textbox[ThisSale]
to
have a zero value, but cannot make this happen. I have tried:
ThisSale.value = 0 and simply ThisSale = 0 , but the value of
zero
does
not appear. Is there something obvious I am missing? It continues to
have
the
value of a previous sale. Both the BarCode and ThisSale are in the
SubForm.
Thanks

Take a look at the Format property of the textbox. If there's a format
pattern there, remove it and re-try the form.
 
P

Pete

Unfortunately, the code still does not work, even with the scanner. It does
work when done by hand. So we are back to trying to simulate that in some
creative way, or improving on the coding mentioned earlier.

Pete said:
It will be a couple of days before the coding can be tested with a scanner,
so thanks for the moment, and I will report later as to the resolution of the
problem in practice.

Stuart McCall said:
Answers inline:

Pete said:
I now note that when the [Barcode] is put in manually and the Enter key
pressed the Textbox value for [ThisSale] does change to Zero on update of
the
Barcode. However, the whole object is to use a scanner. Nevertheless, does
this give a clue as to how the problem may be resolved?

Well if you intend to use a 'wedge' scanner (ie one that sits between the
keyboard and the PC) then your problems are over. The scanner simply
'presses the keys' just as if a human had done it.
:

I removed the (fixed) format from the text box [ThisSale], but on update
of
the [Barcode] the value of [ThisSale] still equates with the previous
sale
and does not equate with zero. You say 'retry the Form' - is there
something I should be doing with the Form? I have been working on the two
textboxes within the SubForm. Sorry if I am slow to understand.

All I meant by 'retry the Form' was to run the form as the user would
normally.
:

In a SubForm, afterupdate of the [BarCode] I want the
textbox[ThisSale]
to
have a zero value, but cannot make this happen. I have tried:
ThisSale.value = 0 and simply ThisSale = 0 , but the value of
zero
does
not appear. Is there something obvious I am missing? It continues to
have
the
value of a previous sale. Both the BarCode and ThisSale are in the
SubForm.
Thanks

Take a look at the Format property of the textbox. If there's a format
pattern there, remove it and re-try the form.
 
S

Stuart McCall

Pete said:
Unfortunately, the code still does not work, even with the scanner. It
does
work when done by hand. So we are back to trying to simulate that in some
creative way, or improving on the coding mentioned earlier.
<snip>

Are you sure the scanner is set to press Enter after the barcode value? This
can usually be switched on or off.

Also (I'm pretty sure you'll know this but I thought I'd mention it anyway)
the textbox must have the focus when you perform a scan.
 
P

Pete

I had the SetFocus correct but the Scanner setting feature I didn't know
about. Matter resolved. Thanks for your attention and insight. The User is
very happy at the outcome.
 
S

Stuart McCall

Pete said:
I had the SetFocus correct but the Scanner setting feature I didn't know
about. Matter resolved. Thanks for your attention and insight. The User is
very happy at the outcome.

Hi Pete

Great News! Glad you got it working.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top