473,403 Members | 2,183 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,403 software developers and data experts.

How to filter a record using barcodes

I have a form called “Front” with an unbound textbox called "BarcodeCapture"

I have another form called "Gen_Users" which holds all my client information with a bound textbox called “BarCode”

“BarCode” contains a random number generated using Rnd()

I want to be able to enter a number into “BarcodeCapture” (ie scan a barcode) and automatically go to the corresponding record in Gen_Users.

I have tried to use the applyfilter function but I am getting nowhere. Any help would be greatly appreciated as I have spent ages going round in circles.

Thanks
Sep 16 '10 #1
8 2004
TheSmileyCoder
2,322 Expert Mod 2GB
Do you have a function to capture the barcode? If not I can try to find a thread from a while back discussing such an issue.

Once you have it, you can use code like:
Expand|Select|Wrap|Line Numbers
  1. Me.RecordSet.Findfirst "Barcode=" & me.BarCode
to go to your item.
Sep 16 '10 #2
Thanks for your reply. No I don't have a function to capture the barcode. If you have one it would be fantastic.
Sep 16 '10 #3
liimra
119 100+
What TheSmileyOne stated will work when you have TheCapture field on the same form. You have the two fields on different forms, so I think you must use the OpenForm function to open the record that matches the criteria (barcode).

Add the following code to the AfterUpdate Event of the "BarcodeCapture" field on the "Front" Form.

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm "Gen_Users", acNormal, , "Barcode = " & Forms!Front!BarcodeCapture
Now once you update the "BarcodeCapture" field, the other form will open where the barcode is equal to the barcodecapture.

Of course, you can add the code to the OnClick event of a button on the "Front" Form or to any other event.

Regards,
Ali
Sep 16 '10 #4
Thanks for the code. It works fine on a button click but not in the unbound textbox which is very confusing? I have tried it onclick, onchange and on update and it filters but always gives the first record? Like I say it works fine in the onclick of the button, maybe it's an unbound issue?
Sep 16 '10 #5
liimra
119 100+
I would recommend that you filter on button click; you however can filter with any other event. For instance, you can filter on the LostFocus event of the unbound text field, or on its AfterUpdate event. One problem with the OnClick event is that it will open the form even when the field is empty (of course you can overcome this by using If...Then); Another thing is that you have to click it again when entering the barcode and this what is causing the confusion. All in all, you can use AfterUpdate or LostFocus but again I advise to use separate button.

Anyways, try these events and let me know if you still have an issue.

Regards,
Ali
Sep 16 '10 #6
TheSmileyCoder
2,322 Expert Mod 2GB
This is the post I was thinking about.
how--to-get-scanned-data-into-my-forms
Sep 16 '10 #7
Thank you so much for your help guys. I think I have it working from a button and assuming my tests go well I am very pleased with what i have.

Thanks again
Sep 17 '10 #8
liimra
119 100+
Happy to know that. Please mark this post as answered so it becomes more helpful for others.

Regards,
Ali
Sep 17 '10 #9

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

Similar topics

18
by: Panchal V | last post by:
I want to access a variable length record in C, the format is as follows : +---+---+-----------+ | A | L | D A T A | +---+---+-----------+ A - Some Data (1 BYTE) L - Length the Data that...
2
by: rajvbprogramer | last post by:
here is my problem. i have two records. one containing 20 records and second containing 30 records. now i want the recordcount property to use and go to the 21 record. i m calculating the...
0
by: durga2005 | last post by:
Hi I m using webgrid control I m trying to add a new record using the footer. I have three columns in webgrid control namely id, type and category. Id is automatically generated when using...
5
by: mukeshrasm | last post by:
Hi I am displaying record using php. I am giving the record structure in html format. Admin will allow user to view the no. of record user will view. <table>...
17
by: ganesh raj | last post by:
Hi, want to write an plsql code to update a single record using rowid where all the rows are duplicated could someone help me in this case. Prod_service_id Location feature ord...
0
by: Big Daddy | last post by:
I am trying to do all my DB access through LINQ. For example, I am trying to delete a record from the JobQueue table. There’s a couple ways I could do this: 1. Method 1 – The disadvantage is...
1
by: sknaina | last post by:
Hi Eveybody, I've a main form with a continuous subform based on 'DonorTranSmasterF' & 'DonorTranSdetailsF' , both tables are linked via 'DonorTransiD' field. I know & learn , How to save record...
1
by: mbbum88 | last post by:
Hi there, I'm still relatively new to Access and am trying to build a database to track applicants for jobs. The form I'm having a problem with is one for "Editing applications". I want to use...
2
by: raamay | last post by:
hello experts, i have fetched records from mysql database and against each record i want to place a update tag which when clicked will update the corresponding record using ajax and php. But here...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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...

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.