|
-
November 22nd, 1999, 11:11 AM
#1
Creating a new invoice
In my program I want to click a new invoice button that will clear all fields and in my invoice number field increase the number by one according to the highest invoice number in my database, but it won't. Any ideas? I really could use some help before tomorrow.
Thanks
Jessica Tracy
-
November 22nd, 1999, 11:32 AM
#2
Re: Creating a new invoice
Jessica,
If you could provide more information about which grid you are using , as there are different types, what Database type you are using would be helpfull. I have had some of the same problems in the past and the answers are different for each one.
Email your replies and I will help.
Allen Noakes
VB Programmer/Analyst
Dames & Moore Group
[email protected]
-
November 22nd, 1999, 11:57 AM
#3
Re: Creating a new invoice
In this program I am just using textboxes and I want my textbox to increment 1 from the highest invoice number already in my database. I am using DAO also. It seems like it should be so simple, but yet I can't get it to work. I'd appreciate any help you could give me.
Thanks
Jessica
-
November 22nd, 1999, 02:58 PM
#4
Re: Creating a new invoice
The answer is as follows.
Dim strSQL as string
strSQL = "SELECT TOP 1 InvoiceNbr FROM Invoice ORDER BY InvoiceNbr DESC;"
The "TOP 1" will return only one record which is all you need, "ORDER BY InvoiceNbr DESC" will get the largest invoice number in your database. This should work with either SQL Server or Access.
Allen Noakes
VB Programmer/Analyst
Dames & Moore Group
[email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|