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]
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
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]