Wrox Programmer Forums
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 8th, 2007, 01:46 AM
Registered User
Join Date: Oct 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

I am new in the area and I try to write some lines but I need your help
I work with 2003 version
Now, I have made a db, the part are:
1 table with 5 columns id, barcodes, pieces, weight, colour
1 same but with no data 1 qry based on 1 tbl of choose and
1 frm with compo frame barcode and pieces, weight, colour
(The only variable is the pieces) winch I have connect the 4 columns with code
The line of compo come from SQL:* and barcode

Let’s say what I enter a barcode
When a write for 2 times the same bc I want to add the number of pieces this time to the previous entry

How I input the data?
In data sheet view with my barcode machine I import my bc automatic
All the line is preset by the tbl1 who include the data
I have set in options in move after enter the cursor goes to the next record
So I just push the button of my bc machine
Describe the barcode
The bc has one arrow in the end .If I click in the arrow appears the
Others columns, pieces weight and color
I connect all with a code from bor code control elements
The code I use is:
> > Private Sub BARCODE_AfterUpdate ()
> > Me. pieces = Me.BARCODE.Column (1)
> > Me. weight = Me.BARCODE.Column (2)
> > Me.colour = Me.BARCODE.Column (3)
> > End Sub

What’s happen now?
When I enter a same bc the line appears as the times I input the same bc
For different its wok normal
What I want now?
If I input the same bc for multiple times the number of
Pieces just add

Please can you help me?

Old October 23rd, 2007, 12:21 PM
Registered User
Join Date: Oct 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts

I think that what you really want to do is load the records from the barcode machine into a recordset and loop through it, each time checking the table that you are inserting into for the bar code #. If you find it, then you update that record such as;

'rs as recordset you are inserting into or updating

'rst as recordset from barcode machine
rs("Pieces") = rs("Pieces") + rst("Pieces")

I know this is a very short code snipet, but I think it should give you an ideal of how to handle this.


Similar Threads
Thread Thread Starter Forum Replies Last Post
fscanf for double akira32 Visual C++ 1 August 13th, 2007 07:38 PM
Always a New entry scandalous Access 3 January 26th, 2007 04:02 PM
Double-buffering katsarosj ASP.NET 1.0 and 1.1 Professional 2 March 2nd, 2004 08:31 PM
Double E-Mails SerranoG Forum and Wrox.com Feedback 1 December 9th, 2003 03:56 PM
Database Double Entry isg2000 Access ASP 1 June 13th, 2003 04:30 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.