G
Guest
I made a form that generates a number when certain field is clicked on. The
problem that i have is that when i go back to the record and click on the
field, it generates a new number. I added another IF statement to the
existing code that supposed to make the field read only, but it still doesn't
work.
If companycode.Value <> Null Then
companycode.Locked = True
Else
If DCount("[CompanyCode]", "[company]") = 0 Then 'assigns 500 to
companycode = 1
Else
companycode = DMax("[CompanyCode]", "[Company]") + 1 'assigns
End If
End If
End Sub
problem that i have is that when i go back to the record and click on the
field, it generates a new number. I added another IF statement to the
existing code that supposed to make the field read only, but it still doesn't
work.
If companycode.Value <> Null Then
companycode.Locked = True
Else
If DCount("[CompanyCode]", "[company]") = 0 Then 'assigns 500 to
companycode = 1
Else
companycode = DMax("[CompanyCode]", "[Company]") + 1 'assigns
End If
End If
End Sub