Incrementing Invoice Number

B

Bob Vance

When I create my Invoice I have 2 choices an Invoice number or Not and that
works just great, BUT if I open my Invoice again and add a charge when I
close my form it changes my Invoice Number from say 122 to 123, If my
invoice is Zero and add a charge to my Invoice its not a problem, this is
part of my code that must be wrong.........Thanks Bob

If fraSelectInvoiceNoType = 1 Then
recInvoice.Fields("InvoiceNo") = NextInvoiceNo
ElseIf fraSelectInvoiceNoType = 2 Then
recInvoice.Fields("InvoiceNo") = 0
End If
 
P

Pete D.

Could we see the rest of the code? Don't know the context of the if
statement. Or I'm just dense and that would be normal.
 
A

Arvin Meyer [MVP]

Add another condition:

If Me.NewRecord = True Then
If fraSelectInvoiceNoType = 1 Then
recInvoice.Fields("InvoiceNo") = NextInvoiceNo
ElseIf fraSelectInvoiceNoType = 2 Then
recInvoice.Fields("InvoiceNo") = 0
End If
End If
 
P

Pete D.

That was nice...I'm sure it could have nothing to do with experience or any
thing like that. Thanks for the "polite" lesson!
 
A

a a r o n . k e m p f

In Microsoft's own words....
The following comes from Microsoft article Q300216.

-----------------------------------------------------------------------------------------------------------------------------------------------------------
"Microsoft Jet is a file-sharing database system. A file-sharing
database is one in which all the processing of the file
takes place at the client. When a file-sharing database, such as
Microsoft Jet, is used in a multiuser environment,
multiple client processes are using file read, write, and locking
operations on the same shared file across a network. If,
for any reason, a process cannot be completed, the file can be left in
an incomplete or a corrupted state. Two
examples of when a process may not be completed is when a client is
terminated unexpectedly or when a network
connection to a server is dropped.

Microsoft Jet is not intended to be used with high-stress, high-
concurrency, 24x7 server applications, such as Web,
commerce, transactional, and messaging servers. For these type of
applications, the best solution is to switch to a true
client/server-based database system such as Microsoft Data Engine
(MSDE) or Microsoft SQL Server. When you use
Microsoft Jet in high-stress applications such as Microsoft Internet
Information Server (IIS), customers have reported
database corruption, stability issues such as IIS crashing or locking
up, and also a sudden and persistent failure of the
driver to connect to a valid database that requires re-starting the
IIS service."
 
G

Gina Whipp

The title to which Aaron refers to is:

How to keep a Jet 4.0 database in top working condition in Access 2000

Link: http://support.microsoft.com/kb/300216

Maybe you could find something more recent and pertinent?
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

message
In Microsoft's own words....
The following comes from Microsoft article Q300216.

-----------------------------------------------------------------------------------------------------------------------------------------------------------
"Microsoft Jet is a file-sharing database system. A file-sharing
database is one in which all the processing of the file
takes place at the client. When a file-sharing database, such as
Microsoft Jet, is used in a multiuser environment,
multiple client processes are using file read, write, and locking
operations on the same shared file across a network. If,
for any reason, a process cannot be completed, the file can be left in
an incomplete or a corrupted state. Two
examples of when a process may not be completed is when a client is
terminated unexpectedly or when a network
connection to a server is dropped.

Microsoft Jet is not intended to be used with high-stress, high-
concurrency, 24x7 server applications, such as Web,
commerce, transactional, and messaging servers. For these type of
applications, the best solution is to switch to a true
client/server-based database system such as Microsoft Data Engine
(MSDE) or Microsoft SQL Server. When you use
Microsoft Jet in high-stress applications such as Microsoft Internet
Information Server (IIS), customers have reported
database corruption, stability issues such as IIS crashing or locking
up, and also a sudden and persistent failure of the
driver to connect to a valid database that requires re-starting the
IIS service."
 
W

Walt Kowalski

to aaron:
Maybe you could find something more recent and pertinent?

Miss Gina, it's been explained to me that boy's mentally unbalanced. If he'd
had the guts to join and fight, they might call it shell-shock and the VA
could help him.

You can call me Walt. I like your style.
 
B

Bob Vance

Oops it is not changing the invoice number when I open the form and close it
But If I create a new Invoice with the option to give it a number it will
only give it a zero..Regards Bob
 
G

Gina Whipp

MR. Walt...

While your statement about his mental health is true, I only offer the link
as a retraction to his.
 
B

Bob Vance

Thanks Arvin got it going just had to put that code in again as there was 2
places it was sitting....Regards Bob
 
A

Arvin Meyer [MVP]

While all of that information is basically true, it neglects to mention that
a split database, rarely corrupts because nothing is shared except the data,
and that is locked by the user currently writing to that record or page.

While it alludes to network server connections being dropped as a cause for
corruption, it neglects to mention that tables without memo fields being
written to rarely corrupt, even with dropped connections. It also doesn't
mention that high quality networks, rarely drop a connection. Further, it
doesn't mention that transactional processing from unbound forms with
rollback will almost never have a problem either.

So databases designed by intelligent professionals, almost never suffer from
any of the problems mentioned. That said, if there is a mission critical
application that requires high security on a 24/7 basis, it makes sense to
spend the extra money for software, hardware, and administration to set up
and run a full SQL-Server application.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


message
In Microsoft's own words....
The following comes from Microsoft article Q300216.

-----------------------------------------------------------------------------------------------------------------------------------------------------------
"Microsoft Jet is a file-sharing database system. A file-sharing
database is one in which all the processing of the file
takes place at the client. When a file-sharing database, such as
Microsoft Jet, is used in a multiuser environment,
multiple client processes are using file read, write, and locking
operations on the same shared file across a network. If,
for any reason, a process cannot be completed, the file can be left in
an incomplete or a corrupted state. Two
examples of when a process may not be completed is when a client is
terminated unexpectedly or when a network
connection to a server is dropped.

Microsoft Jet is not intended to be used with high-stress, high-
concurrency, 24x7 server applications, such as Web,
commerce, transactional, and messaging servers. For these type of
applications, the best solution is to switch to a true
client/server-based database system such as Microsoft Data Engine
(MSDE) or Microsoft SQL Server. When you use
Microsoft Jet in high-stress applications such as Microsoft Internet
Information Server (IIS), customers have reported
database corruption, stability issues such as IIS crashing or locking
up, and also a sudden and persistent failure of the
driver to connect to a valid database that requires re-starting the
IIS service."
 
B

Bob Vance

Sorry Arvin , It is not giving me a Invoice Number when I select it too,
thought I had fixed it but hadnt ....Regards Bob
 
A

a a r o n . k e m p f

a) Jet doesn't have real locking
b) Jet doesn't have a real database log
c) Jet doesn't have real transactions.

so now _WHAT_ are you talking about?

You're right-- databases that are built by _PROFESSIONALS_ are built
in SQL Server, that's why they don't have these problems.
You're not some sort of 'database architect' just because you run the
database splitting wizard in Jet.

Learn how to use the worlds most popular database before you try to
boss me around, script kiddie!

-Aaron
MCITP: SQL 2005 DBA
 
A

Arvin Meyer [MVP]

OK, now that you're done talking to yourself <lol> let's solve your problem.
First, you may be able to avoid getting a new number depending upon your
code and where it's placed. That may solve the other problem as well. So
give me some more information. What triggers your code? And what does the
sub NextInvoiceNo look like?
 
A

Arvin Meyer [MVP]

message
a) Jet doesn't have real locking
b) Jet doesn't have a real database log
c) Jet doesn't have real transactions.
so now _WHAT_ are you talking about?

Once again, you're full of it. The only logging Jet has is one that's
created by the developer. Since most databases run faster without logging,
even SQL-Server developers won't often use logging in non mission critical
applications. Jet does have both locking and transaction capabilities. I've
used Transactions since version 2.0. That's almost 15 years ago.
You're right-- databases that are built by _PROFESSIONALS_ are
built in SQL Server, that's why they don't have these problems.

You have no idea what a professional is. They laugh you out of the
SQL-Server newsgroups, the same as we do here.
You're not some sort of 'database architect' just because you run
the database splitting wizard in Jet.

Nor are you because you have a big mouth!
Learn how to use the worlds most popular database before you
try to boss me around, script kiddie!

Well, son, I happen to have more experience than you have years. And much
more skill than you have mouth.
-Aaron
MCITP: SQL 2005 DBA

BTW, it's interesting how no one seems to be able to verify your
certification claims. When did you get certified?
 
B

Bob Vance

Thanks Arvin found the problem it was on the close control of the form it
used subsetInvoiceValues so I copied the code changed its name and took out
the Incriminate Invoice number changed its name to
subsetInvoiceValuesNoNumber and changed my Close control to that BINGO :)
Thanks Bob
 
A

a a r o n . k e m p f

Arvin;

Where do you come up with this shit?

Seriously?

Go and learn something about databases before you try to pretend.

For the record, you can't -turn-off-logging- in SQL Server; it's
blatantly impossible.
Furthermore, there are more advanced tools like 'profiler' and
'blackbox'

They don't laugh me out of the SQL Server newsgroups.
But I guess you think that you have a good strategy for attacking my
credibility.

The fact of the matter is that I'm certified in the worlds most
popular database.

And you've been clinging to this obsolete crappy database because
you're too fucking stupid to learn a professional database.

Jet is dead and it has been for a long time.

I got certified, MCITP: DBA SQL 2005 almost 2 years ago now.. I think
that it was technically 22 months ago.

I don't need to prove shit because Tony Toews and other fags on this
group collect information about me and attack me and my employers.
i mean _DUH_ I don't need to give you stalkers any more personally
identifiable information.

-Aaron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top