Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding letters to invoice number

Status
Not open for further replies.

techkenny1

Technical User
Joined
Jan 23, 2009
Messages
182
Location
AU
Hi,

I would appreciate some advice on how I do this..

I use an invoice form which has an invoicenumber.
The companies I deal with desire all credits to have the same no as the invoice.
I have set up a system so that this happens. What I would like to do is to be able to add "-CR" to the invoice number.
The invoicenumber field is a text field. The letters "CR" indicate that it is a credit note.

Eg: Invoice No = 1234
Credit note No = 1234-CR
Many thanks

Ken
 
How are ya techkenny1 . . .

I don't know how your generating your invoice number, but all you have to do is concatenate "-CR".

Say you have a function named NewInvNum that returns the next invoice number. Code would look like:
[blue]Me!TextboxName = NewInvNum & "-CR"[/blue] or you could concatenate right in the function.

[blue]Your Thoughts? . . .[/blue]

BTW: Welcome to [blue]Tek-Tips![/blue] [thumbsup2] Do have a look at one of the links at the bottom of my post. The links will help you [blue]ask better questions[/blue], get [blue]quick responses[/blue], [blue]better answers[/blue], and insite into [blue]etiquette[/blue] here in the forums. Again . . . Welcome to [blue]Tek-Tips![/blue] [thumbsup2] [blue]Its Worthy Reading![/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Hi the Aceman1
I generate invoice numbers with the following code.
"Me.InvoiceNumber = Nz(DMax("InvoiceNumber", "accounts08"), 0) + 1"
So will try your reply.

Thanks,

ken
 
What about something like this ?
Me!CreditNumber = Me!InvoiceNumber & "-CR"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
be aware that the method you are using can (e.g. WILL) fail (or at least screw up the invoice numbering) at some point if you have set up the db as multiuser.

further, your approach will complicate retrieval of data. For example, finding all the records related to a particular invoice will require additional criteria to include the ones w/ "-CR". A better soloution (in my opinioon) would be to add the field to denote credit / debit.




MichaelRed


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top