rashidzaib
Registered User.
- Local time
- Today, 01:47
- Joined
- Aug 12, 2007
- Messages
- 32
hy
i hope all r fine.
sorry for disturbing you again.
i have problem in auto generation of primary key field.
on field i have written on enter event the dmax function.
but when cursor is going on that field automaticaly next number is appered
and also it update the old record if i first time run the form. and also if u r deleting the rcord it will show u next max number example
if u have 4 record and next max number is 5 then if u delete the previoud item code will be six and so on.
i also have enter the code on before update form
Private Sub form_BeforeUpdate(Cancel As Integer)
If Not (Me.NewRecord) Then
If MsgBox("would u save changes to this record", vbQuestion + vbYesNo + vbDefaultButton1, "save changes to record") = vbNo Then
Me.Undo
End If
else
If MsgBox("would u save this record", vbQuestion + vbYesNo + vbDefaultButton1, "save this to record") = vbNo Then
Me.Undo
end if
End If
End Sub
but when i am clicking any button on form it is showing that do u want save changes
or
even deleting record it is showing that msg.
is there any solution so that i should get rid of this problem.
thank u and best regard
take care bye
i hope all r fine.
sorry for disturbing you again.
i have problem in auto generation of primary key field.
on field i have written on enter event the dmax function.
but when cursor is going on that field automaticaly next number is appered
and also it update the old record if i first time run the form. and also if u r deleting the rcord it will show u next max number example
if u have 4 record and next max number is 5 then if u delete the previoud item code will be six and so on.
i also have enter the code on before update form
Private Sub form_BeforeUpdate(Cancel As Integer)
If Not (Me.NewRecord) Then
If MsgBox("would u save changes to this record", vbQuestion + vbYesNo + vbDefaultButton1, "save changes to record") = vbNo Then
Me.Undo
End If
else
If MsgBox("would u save this record", vbQuestion + vbYesNo + vbDefaultButton1, "save this to record") = vbNo Then
Me.Undo
end if
End If
End Sub
but when i am clicking any button on form it is showing that do u want save changes
or
even deleting record it is showing that msg.
is there any solution so that i should get rid of this problem.
thank u and best regard
take care bye