Thanks for that. Although, its not seem to be working. And instead of using a label, i would like to use a textbox for it.
Ive added what you said but it doesnt seem to work this is how i put it:Private Sub Command1_Click()
OccuranceLog.TextBox22.AutoSize = True
OccuranceLog.TextBox22.Text = NewNumber()End SubPublic Function NewNumber() As StringStatic intNewNumber As IntegerDim strNumber As StringDim strDate As String
intNewNumber = intNewNumber + 1
strNumber = Format(intNewNumber, "C-00000#/WJ")
strDate = Format(Now, "dd:MMM:yy")
NewNumber = strNumber & "/" & strDateEnd Function
The extra C- and /WJ that ive added is just to make a unique reference number as there are a few on my forms.
Its set out as form1 has a button, when i click that button it opens up form2 and inputs some of the data for me like date time etc and now hopefully this reference number.
Am i doing something wrong?
Thanks for your help