|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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!
|
|
#2
|
|||
|
|||
|
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.
|
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
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!
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Command Button to generate an invoice number |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|