473,541 Members | 16,424 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help:creating a new invoice?

Hi there i have a little problem with my invoice.

Here it is:

i have a main menu with buttons, one of my button is "Create new
invoice", when click on it a form pop up so i can enter my information
and one of the field (the user cannot change the info in it.) is
invoice #. Right now, everythime i click on "Create new invoice", the
invoice # add 1. But my problem is sometime the employee dont fill it
(for x reason) and shut it down, the nest time they will click on
"Create new invoice" the invoice # will be 1 more then the last one.
There will be a blank invoice between them.

Is there a way to get rid of this??

thx a lot.

Nov 13 '05 #1
15 5259

"No***********@hotmail.com" <ug********@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hi there i have a little problem with my invoice.

Here it is:

i have a main menu with buttons, one of my button is "Create new
invoice", when click on it a form pop up so i can enter my information
and one of the field (the user cannot change the info in it.) is
invoice #. Right now, everythime i click on "Create new invoice", the
invoice # add 1. But my problem is sometime the employee dont fill it
(for x reason) and shut it down, the nest time they will click on
"Create new invoice" the invoice # will be 1 more then the last one.
There will be a blank invoice between them.

Is there a way to get rid of this??

thx a lot.

Have the employee supply required information before creating a new invoice
number.
Nov 13 '05 #2
how do i do that? any hint?

Nov 13 '05 #3
have the button that creates the invoice check that all required fields
are filled in first.

Nov 13 '05 #4
have the button that creates the invoice check that all required fields
are filled in first - before allowing an invoice to be created at all.

Nov 13 '05 #5
In message <11**********************@z14g2000cwz.googlegroups .com>,
"No***********@hotmail.com" <ug********@hotmail.com> writes
Hi there i have a little problem with my invoice.

Here it is:

i have a main menu with buttons, one of my button is "Create new
invoice", when click on it a form pop up so i can enter my information
and one of the field (the user cannot change the info in it.) is
invoice #. Right now, everythime i click on "Create new invoice", the
invoice # add 1. But my problem is sometime the employee dont fill it
(for x reason) and shut it down, the nest time they will click on
"Create new invoice" the invoice # will be 1 more then the last one.
There will be a blank invoice between them.

Is there a way to get rid of this??


It depends on how the new invoice numbers are created. What you need is
a system that creates a new invoice number in the before_insert trigger
of the form.

Are you using autonumber?

--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author.

Nov 13 '05 #6
No***********@hotmail.com wrote:
Hi there i have a little problem with my invoice.

Here it is:

i have a main menu with buttons, one of my button is "Create new
invoice", when click on it a form pop up so i can enter my information
and one of the field (the user cannot change the info in it.) is
invoice #. Right now, everythime i click on "Create new invoice", the
invoice # add 1. But my problem is sometime the employee dont fill it
(for x reason) and shut it down, the nest time they will click on
"Create new invoice" the invoice # will be 1 more then the last one.
There will be a blank invoice between them.

Is there a way to get rid of this??

thx a lot.

Is the Invoice number an autonumber field? If so, this is to be
expected. An autonumber is not a good method to use for sequential
numbers. An autonumber is GREAT as a key field to link to other tables.

If you enter anything into the form, the autonumber increments. Even if
you undo your changes, the next time the invoice form is opened, a new
number will be one more than the last time an autonumber was
incremented, whether or not the record was saved. So you can expect
holes in the sequence.

The better thing to do is make the invoice number field in your table a
LongInt number. Simply remove the Autonumber type from the table and
change it to Number, type Long. And make it the primary key.

Now you need to determine when you want the record to create new invoice
number. If ONLY ONE person is updating/creating invoices, you can do
something like
If Me.NewRecord then
Me.InvoiceNumber = Dmax("InvoiceNumber","InvoiceTable")
Endif
anytime you want. If you are going to have multiple people entering
invoice numbers at the same time, you might want to do that in the
BeforeUpdate event of the form...IOW, just prior to saving the record.
Nov 13 '05 #7

"No***********@hotmail.com" <ug********@hotmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
how do i do that? any hint?


Have your Create Invoice button display an unbound dialog box showing only
the required fields with an OK and CANCEL button. If the user clicks OK,
verify the required fields, append the data and next invoice number to the
table and open the Invoice form to the new record. You could also add a user
ID field to your invoice table to identify who created each invoice.
Nov 13 '05 #8
Yes i'm using the auto number....and not +1..

Nov 13 '05 #9
In message <11**********************@g44g2000cwa.googlegroups .com>,
"No***********@hotmail.com" <ug********@hotmail.com> writes
Yes i'm using the auto number....and not +1..


That's risky in this situation. Auditors will ask questions if they find
gaps in the invoice number sequence. It's far better to create the
invoice numbers yourself so that you have complete control over them.

--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author.

Nov 13 '05 #10
ok, but i dont want them to enter it manually, to risquy i think, and
they wont remember what was the last invoice number?

Nov 13 '05 #11
and on my form i have a Save button and a Back tu main menu button.
even if i dont save it the autonumber goes up by 1 each time.

Nov 13 '05 #12
If it's a numeric column in the table for invoice number you
can use DMax() to get the highest existing value then add 1
to it.

--
Nick Coe (UK)
Available - Will work for money :-)
http://www.alphacos.co.uk/ AccHelp + pAnimal
http://www.pjandcoe.co.uk/ Online Store

In
news:11*********************@g14g2000cwa.googlegro ups.com,
No***********@hotmail.com typed:
ok, but i dont want them to enter it manually, to risquy i
think, and they wont remember what was the last invoice
number?

Nov 13 '05 #13
In message <11**********************@f14g2000cwb.googlegroups .com>,
"No***********@hotmail.com" <ug********@hotmail.com> writes
and on my form i have a Save button and a Back tu main menu button.
even if i dont save it the autonumber goes up by 1 each time.


One way to handle this is to search the invoice table for the largest
invoice number, add one to it and then use this as the next invoice
number. If it is a large table this could be slow.

Another approach is to use a table that has one row and one field. When
you create an invoice you:

1. read the number stored there
2. add one to it
3. store the new number, overwriting the old one
4. create the invoice record using the new number

The order that you do things can be important. If the process is
interrupted or fails part way it is better to have a gap in the sequence
than to have two invoices with the same number.


--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author.

Nov 13 '05 #14

"Bernard Peek" <ba*@shrdlu.com> wrote in message
news:YW**************@shrdlu.com...
In message <11**********************@f14g2000cwb.googlegroups .com>,
"No***********@hotmail.com" <ug********@hotmail.com> writes
and on my form i have a Save button and a Back tu main menu button.
even if i dont save it the autonumber goes up by 1 each time.


One way to handle this is to search the invoice table for the largest
invoice number, add one to it and then use this as the next invoice
number. If it is a large table this could be slow.

Another approach is to use a table that has one row and one field. When
you create an invoice you:

1. read the number stored there
2. add one to it
3. store the new number, overwriting the old one
4. create the invoice record using the new number

The order that you do things can be important. If the process is
interrupted or fails part way it is better to have a gap in the sequence
than to have two invoices with the same number.


--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author.

dMAX will not take long if the Invoice number is indexed.
You can't have a duplicate invoice if the invoice number is the primary key.
You will need to check that your append query succeeded before opening the
invoice form, because a 2nd user may grab the next invoice number a split
second before the 1st
Nov 13 '05 #15

"Bernard Peek" <ba*@shrdlu.com> wrote in message
news:YW**************@shrdlu.com...
In message <11**********************@f14g2000cwb.googlegroups .com>,
"No***********@hotmail.com" <ug********@hotmail.com> writes
and on my form i have a Save button and a Back tu main menu button.
even if i dont save it the autonumber goes up by 1 each time.


One way to handle this is to search the invoice table for the largest
invoice number, add one to it and then use this as the next invoice
number. If it is a large table this could be slow.

Another approach is to use a table that has one row and one field. When
you create an invoice you:

1. read the number stored there
2. add one to it
3. store the new number, overwriting the old one
4. create the invoice record using the new number

The order that you do things can be important. If the process is
interrupted or fails part way it is better to have a gap in the sequence
than to have two invoices with the same number.


--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author.


Dmax would search a large table quickly if Invoice number is indexed.
Invoice number could not be duplicated if Invoice number is the primary key.
You would need to check that the append query succeeded before opening to
the new invoice. A 2nd user may grab the next number just before the 1st,
causing a key violation in the append query.
Nov 13 '05 #16

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

Similar topics

2
9167
by: Sami | last post by:
Could someone explain clearly how to go about doing this? I have tried setting up the structure on numerous occasions, but it never seems to work. Could someone please help me out? Thanks!
0
1018
by: Ivan Palčić | last post by:
Hi i need to make an invoice(report) with nummbers (like 1/04, 2/04...) but each Customer must have invoice starting with 1/04 referring to the date they must pay. An example Customer: Something MustPay_Date: 27/06 Invoice_NR: 01/04 following MustPay_Date: 30/06
4
7387
by: Phil | last post by:
k, here is my issue.. I have BLOB data in SQL that needs to be grabbed and made into a TIF file and placed on the client (could be in temp internet dir). The reason we need it in TIF format is there are multiple pages per invoice. How can I grab the data, make the TIF, place it on the client and then Open with the clients default program...
1
2957
by: simon | last post by:
Hello, i'm looking to create an aspx page that is basically a FAQ page i'm not sure if this can be done, but would love some help with suggestions of how to do it another way if this is not possible on the aspx page i have a table with 1 row and 2 columns in it, in the column on the left i have an asp:label, lblLinks and in the column on...
10
5085
by: moondaddy | last post by:
I'm new to c# and .net 2.0. In the old vb.net 1.1 days I normally created a list class for every business class and used this list class for all databinding rather than using datasets. This is because often I wanted to edit data in the list and therefore needed to talk to the business object and not the dataset. Since this was a must, I...
4
1866
by: DeanL | last post by:
Hi Guys, I need some help creating a query that is going to take between 1 and 10 parameters. The parameters are entered on a form into text boxes that may have data or be empty. Is there a way to create a single query that will take parameters if they are present in the text boxes and not take parameters if the text box is empty? The...
2
8037
by: JC | last post by:
I'm looking for help creating a keylogger program.It doesn't have to be hidden because I want to allow people access to what they have written. Can anyone help me with this or send me tutorials or code on how to create a keylogger. Thanks *** Sent via Developersdex http://www.developersdex.com ***
1
3499
newnewbie
by: newnewbie | last post by:
Desperately need help in creating a query to count unique values in a table. I am a Business analyst with limited knowledge of Access….My boss got me ODBC connection to the underlying tables for our system and thinks I am omnipotent now and can extract any data out of it in the form he wants….The truth is, though I know SOME Access, I am not a...
6
7989
by: firefighter17103 | last post by:
Hi All, I am new to MS Access 07, & do not know any VB, on a new business adventure. I am running Office07 on Vista Home Premium. I am in the process of creating a database that in the end I will be able to create quotes, bill out customers for security services, cctv products and installs,create purchase orders to my distributors being that...
0
7373
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7317
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
7307
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
7659
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5849
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...
0
4870
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
3367
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
938
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
606
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.