Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 8th, 2003, 07:59 AM
drew123 drew123 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 1 drew123 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Command Button to generate an invoice number

I need to set up a command button that a user will click on where it generates an auto number. This is for an existing database that is used to input invoice numbers. Normally an invoice number is available for the user to input. However, occasionally the user does not have an invoice number. I would like this generated number to begin with "MVA-" then a number (can begin with 1 then 2 and so on). I have set up a button and a table containing a auto-number column. I just need the code for the button to pull from this table? Or am I barking up the wrong tree? Any help for my minimul VB skills would be helpful!

Reply With Quote
  #2  
Old May 8th, 2003, 02:38 PM
defjamninja defjamninja is offline
Overly white
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Fresno, CA
Posts: 83 defjamninja User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
The column is already set to auto number you can't generate one for it. When a record is added the autonumber field will automagicly put a number in the column for you.

Reply With Quote
  #3  
Old September 6th, 2003, 09:25 PM
stanhargrave stanhargrave is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 1 stanhargrave User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
drew123, I have done this in several apps. First, change the invoice number field to long so you don't lose any of the existing values. Then setup a field that holds the last number used in a table you might call control. When the user presses the new invoice number button, lookup the control field and add 1 to it. Display that on your form and update the control field with the new value as well. If you want the user to create a text value, you can still do this with the control field being numeric. If you have any further questions or need a code sample, PM me.
Stan

Reply With Quote
  #4  
Old September 9th, 2003, 11:54 PM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
Can't use auto number type!It's wrong!Set up a colume with the long integer type.And then Access the DB like what stanhargrave said!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Command Button to generate an invoice number


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT