Nz Question

  • Thread starter plisvb via AccessMonster.com
  • Start date
P

plisvb via AccessMonster.com

Hello all,

My formula works perfectly so far:

Me.inv = Nz(DCount("[OrderID]", "Orders", "[Transaction Type]=2"), 0) + 1

It returns a number that is exactly what I want. However, I'm not sure how
to concatenate a prefix onto the value.

Instead of 126 I want the value to be INV-126

Thanks in advance
 
J

Jim Evans

Try this:
Me.inv = "INV-" & Nz(DCount("[OrderID]", "Orders", "[Transaction Type]=2"),
0) + 1

If you intend saving this entire value, make certain that the field in the
table will accept a String, otherwise you will get an error when your record
is updated.
 
P

plisvb via AccessMonster.com

Thanks Jim,

This worked perfectly

Cheers

Jim said:
Try this:
Me.inv = "INV-" & Nz(DCount("[OrderID]", "Orders", "[Transaction Type]=2"),
0) + 1

If you intend saving this entire value, make certain that the field in the
table will accept a String, otherwise you will get an error when your record
is updated.
Hello all,
[quoted text clipped - 9 lines]
Thanks in advance
 
Top