Hi,
I have a textbox that I have hold the value for a case number. The textbox name is caseNum. I want it to be in this format "07KS2007" + caseNum for example 07KS2007123, where the case number is incremented up by 1 with every new case. I have a button that needs to be clicked to add the case number to the case. It has been a while sense I have done this, so I'm a bit rusty. Also, does VBA allow initialization of a variable in the declaration? Here is my code:
Private Sub caseNum_Click()
Dim caseNum As String
Dim number As Integer
number = 500
number = number + 1
caseNum = "07KS" & Year(Date) & number
Me.caseNumber = caseNum
End Sub
Any help would be great! Thanks!
I have a textbox that I have hold the value for a case number. The textbox name is caseNum. I want it to be in this format "07KS2007" + caseNum for example 07KS2007123, where the case number is incremented up by 1 with every new case. I have a button that needs to be clicked to add the case number to the case. It has been a while sense I have done this, so I'm a bit rusty. Also, does VBA allow initialization of a variable in the declaration? Here is my code:
Private Sub caseNum_Click()
Dim caseNum As String
Dim number As Integer
number = 500
number = number + 1
caseNum = "07KS" & Year(Date) & number
Me.caseNumber = caseNum
End Sub
Any help would be great! Thanks!