Before Insert problem - need help

joyaccess1

Registered User.
Local time
Today, 00:15
Joined
Jan 21, 2008
Messages
32
Hi,

My table has the below columns
code
desc
created
createduser

in the form, i have the below 2 fields
code
desc

i have before insert event as
Private Sub Form_BeforeInsert(Cancel As Integer)
Me.Created = Now()
Me.CreatedUser = fOSUserName()
End Sub

The problem is when i insert a new row using the form i get the message "you must enter a value in table.createduser field". but when i insert a row from sqlview it works, and the strange thing is if i use the form after the insert statment i don't get the error message and it inserts a new row successfully. is there something that i need to do for the form to recognize the "beforeinsert" event ?. and why does it work fine after the insert statement from sql view ?

Thanks for you help
Joy
 
better to put these in the before update event (when the completely edited record is finally saved
 
Thanks, but will it work for insert too ?

Thanks
Joy
 

Users who are viewing this thread

Back
Top Bottom