furnitureheaven
Registered User.
- Local time
- Today, 10:42
- Joined
- Aug 5, 2008
- Messages
- 36
Hi,
I have a table in access with 600 records. a field RefNo got numbers in non sequences. I want to put a auto number on this field. so when user click on Add button, its automaticlly generate a number in a RefNo Coloum.
I have a code like this, but its not worked. Could anyone help in this,
I have a table in access with 600 records. a field RefNo got numbers in non sequences. I want to put a auto number on this field. so when user click on Add button, its automaticlly generate a number in a RefNo Coloum.
I have a code like this, but its not worked. Could anyone help in this,
Code:
Private Sub cmdadd_Click()
On Error GoTo Err_cmdadd_Click
DoCmd.GoToRecord , , acNewRec
Me![RefNo] = NewRefNo()
Me![PartyName].SetFocus
Exit_cmdadd_Click:
Exit Sub
Err_cmdadd_Click:
MsgBox Err.Description
Resume Exit_cmdadd_Click
End Sub