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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Right in Dmax 3

Status
Not open for further replies.

lars7

Technical User
Aug 16, 2005
817
GB
Hi,
I have the following code to give me the max of a "codeno" in a field but the first part of the "codeno" is text i,e, DIAG1000

Countmax = DMax("Right([Job Ref No],4)", "[Vac Board]")
Me.[Job Ref No] = Countmax + 1

my problem is that the number part has reached 9999 and if i change the code to:

Countmax = DMax("Right([Job Ref No],5)", "[Vac Board]")
Me.[Job Ref No] = Countmax + 1

I get a type mismatch.

Does anyone know how i can fix this.

Thanks in advance.


 
Hi Ace,
I know my method may not meet with your approval but I am just trying to work with what I have been left with here.

I tried your new bit of code but it only puts the Number into the control RefNo and not the prefix.

Private Sub Prefix_AfterUpdate()
Me.RefNo = NextSerialNum(Me!PreFix)
End Sub


However I have fully tested the code as I posted at 29 Apr 07 15:09 and it works great.
 
lars7 . . .

As you wish. I'm glad you had something viable to work with this mourning [thumbsup2] . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top