Thank you so much June7
I cant tell you how much that helped. It worked out of the gate and i just had to tweek it as I was DMax'ing the wrong field.
Got some pretty interesting numbers along the way, lol...
In any event, it works like a charm and you made this code very simple and simple to understand. Thank you!!!!!!
AND no chance it will ever get cose to 999 so no worries. If it gets more than 200 I QUIT! Been in construction building
buildings for 24 years now and never had an RFI (Request for Information) go over 133 and that architect was rotten to the
core... Most range from 20 to 50 depending on project size.
I ended up putting the call in the afterupdate of Question Field for now. I will make changes to it once i get in my real db as
this was just a mach up for testing.
Code:
Option Compare DatabaseOption Explicit
Public Sub NewRFINum()
Dim sRFI As String
sRFI = Nz(DMax("RFINumber", "RFITbl", "ProjectID=" & Me.ProjectID), "")
If sRFI = "" Then
Me.RFINumber = Me.CboProject.Column(4) & "-001"
Else
Me.RFINumber = Me.CboProject.Column(4) & Format(Right(sRFI, 3) + 1, "-000")
End If
End Sub
Private Sub Question_AfterUpdate()
Call NewRFINum
End Sub
Again, Thank you! Youre awsome