only place the first 6 characters from a form into the table

K

Kberube

I have users using a barcode scanner to scan different size barcodes into a
form. This form updates the appropriate tables. How can i take a field on
the form and only write back to the table the first 6 characters?

Thanks
Kevin
 
R

Rick B

scan it into an unbound control and then write code that will take the left
6 characters from that unbound field and put it into the bound field...


[SomeStoredField] = Left(SomeUnboundControl,6)
 
K

Krberube

Ok Rick, I understand what your saying, but I'm kinda new to this level of
access.
I create the unbound control ( no problem ), Where do I put the code you
mention?

Thanks
Kevin

Rick B said:
scan it into an unbound control and then write code that will take the left
6 characters from that unbound field and put it into the bound field...


[SomeStoredField] = Left(SomeUnboundControl,6)



Kberube said:
I have users using a barcode scanner to scan different size barcodes into a
form. This form updates the appropriate tables. How can i take a field on
the form and only write back to the table the first 6 characters?

Thanks
Kevin
 
R

Rick B

Double-click that new control while in design-view.

You should get a properties box. In the "event"tab, you will select "event
procedure" from the drop-down list for the "On Change" event. Then, click
the elipse (...) to open the code window.

Insert the code I gave you earlier with the correct field names in between
the "Private Sub Xxxxxx_Change()" line and the "End Sub" line.

Then close the Microsoft Visual Basic Window and save your form.

Hope that helps,

Rick B



Krberube said:
Ok Rick, I understand what your saying, but I'm kinda new to this level of
access.
I create the unbound control ( no problem ), Where do I put the code you
mention?

Thanks
Kevin

Rick B said:
scan it into an unbound control and then write code that will take the left
6 characters from that unbound field and put it into the bound field...


[SomeStoredField] = Left(SomeUnboundControl,6)



Kberube said:
I have users using a barcode scanner to scan different size barcodes
into
a
form. This form updates the appropriate tables. How can i take a
field
on
the form and only write back to the table the first 6 characters?

Thanks
Kevin
 
K

krberube

Thanks Rick,
got it all working now.

Thanks again
Kevin

Rick B said:
Double-click that new control while in design-view.

You should get a properties box. In the "event"tab, you will select "event
procedure" from the drop-down list for the "On Change" event. Then, click
the elipse (...) to open the code window.

Insert the code I gave you earlier with the correct field names in between
the "Private Sub Xxxxxx_Change()" line and the "End Sub" line.

Then close the Microsoft Visual Basic Window and save your form.

Hope that helps,

Rick B



Krberube said:
Ok Rick, I understand what your saying, but I'm kinda new to this level of
access.
I create the unbound control ( no problem ), Where do I put the code you
mention?

Thanks
Kevin

Rick B said:
scan it into an unbound control and then write code that will take the left
6 characters from that unbound field and put it into the bound field...


[SomeStoredField] = Left(SomeUnboundControl,6)



I have users using a barcode scanner to scan different size barcodes into
a
form. This form updates the appropriate tables. How can i take a field
on
the form and only write back to the table the first 6 characters?

Thanks
Kevin
 

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