473,394 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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 5245

"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
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
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...
4
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...
1
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...
10
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...
4
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...
2
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...
1
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...
6
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.