473,583 Members | 2,875 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

invoicing routine problem

Back in Dec 03 I was working on an app which included invoicing.
With some help from Allen Browne I got something that has worked with no
probs.
I modifyed the origional app last March to handle a milk processing business
I am involved in.
Again this has been fine with invoice number over 500.
Last week it started producing duplicate invoice number.
The invoice table is correct but It appears to repeat the customer`s last
invoice number in the invoicedetail table.
I have not altered anything for over 2 months.

The setup on asking for an invoice is
1 Grap the details from invoice transactions table and put them in invoice
detail table

2 create a record or records in the invoicetable and the autonumber field
creates the invoice number

3 pick up the invoice number from the invoicetable and update the records
in invoicedetail with the relevant invoice number

The problem appears to be with 3

sql below
1 INSERT INTO invoicedetail ( Activitydate, Activityname, Activitydetail,
starttime, quantity, Priceeach, resourcegroup, customerid, batchid,
transactiontbli d )
SELECT invtransactions q.Activitydate, invtransactions q.Activityname,
invtransactions q.Activitydetai l, invtransactions q.starttime,
invtransactions q.quantity, invtransactions q.Priceeach,
invtransactions q.resourcegroup , invtransactions q.customerid, [Maxbatchid]+1
AS batchid, invtransactions q.itemnumber
FROM batchidmax, invtransactions q
WHERE (((invtransacti onsq.Activityda te) Between
[Forms]![collectforinvoi cefrm]![startdate] And
[Forms]![collectforinvoi cefrm]![enddate]) AND
((invtransactio nsq.quantity)<> 0));
2 INSERT INTO invoicetable ( batchid, custid, invdate )
SELECT Max(invoicedeta il.batchid) AS MaxOfbatchid, invoicedetail.c ustomerid,
Date() AS Expr1
FROM invoicedetail
GROUP BY invoicedetail.c ustomerid, Date(), invoicedetail.i nvoicenum
HAVING (((Max(invoiced etail.batchid)) >0) AND
((invoicedetail .invoicenum)=0) );

3 UPDATE invoicetable INNER JOIN invoicedetail ON invoicetable.cu stid =
invoicedetail.c ustomerid SET invoicedetail.i nvoicenum = [invoicenumber]
WHERE (((invoicedetai l.invoicenum)=0 ) AND ((invoicedetail .Activitydate)
Between [Forms]![collectforinvoi cefrm]![startdate] And
[Forms]![collectforinvoi cefrm]![enddate]));

Would be grateful for any thoughts on what is going wrong

TIA
David B
Jan 26 '06 #1
0 1178

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

Similar topics

1
1707
by: peteh | last post by:
Hi All; I'm having a problem running an external routine (C language) under DB2 8.2 (FP 9) on AIX 5.3. Since the code was mostly copied from the DB2 sample library, I'm pretty sure it's sound. When executed ("call export_util (parm1, parm2, parm3, ?)) it just hangs - nothing happening for several hours - when the table being exported is very...
2
4748
by: William Roberts | last post by:
I am desiging an invoicing program that will do recurring billing as well as charging for any additional service at a given time. All charges will be service oriented. I am particularly concerned with being able to seperate uninvoiced charges and invoiced charges and would appreciate advice on do's or dont's, or any Ideas for a better way to...
5
1706
by: David B | last post by:
I have an app which includes invoicing, which is working fine. I am wondering how best to deal with the situation where the amount paid is different from the amount invoiced. Would it be best to have a separate table or just an extra field in the table that stores invoicenum, amountinvoiced. Any thoughts ? TIA David B Hexham UK
1
1055
by: Chris | last post by:
Hi, I have searched the internet, but havent seen any sample on large scale invoice printing. I am tasked with this project of rerieving data form a database and printing invoices on a daily bases. There will be about 2000 invoices printed on a daily basis. The problem I have is how do I go about doing this. I was thinking of creating a...
2
1279
by: antheana | last post by:
Hi there, NeoPa and mccarthy have helped me with some table design advice previously, but I made a bit of a boo boo. It is with regards to invoicing for a job. tblJobs tblInvoices Now, I have a form called frmJobs that allows me to display everything related to a job e.g. JobID
0
966
by: aa7im | last post by:
I need the source code for an accounting/invoicing/ledger application. Are there any C#/ASP.NET application out there that are either open source or for purchase that I can obtain and utilize for resale? Thanks...
7
2415
by: Bob Darlington | last post by:
I'm using the following routine to call UpdateDiary() - below: Private Sub Form_BeforeUpdate(Cancel As Integer) On Error GoTo Form_BeforeUpdate_Error Call UpdateDiary(Me!TenantCounter, "sfTenantDetailsOther") Exit Sub Form_BeforeUpdate_Error: MsgBox "Error " & Err.Number & " (" & Err.Description & ") " _ & "in procedure...
6
5899
by: RandomElle | last post by:
Hi there I'm hoping someone can help me out with the use of the Eval function. I am using Access2003 under WinXP Pro. I can successfully use the Eval function and get it to call any function with or without parms. I know that any function that is passed to Eval() must be declared Public. It can be a Sub or Function, as long as it's Public. I...
2
1465
by: pvong | last post by:
I'm a newbie. I'm using VS2008 & VB.net I have a simple site and each page uses the same sub-routine. I copy and paste to each page and that's no big deal but that can get tiresome. I was wondering if it's possible to create a MASTER sub routine where all the pages can call it and perform it's task for that page. If so, where would I...
0
7811
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7922
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6571
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5689
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5366
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3811
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3836
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2317
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1416
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.