Error on assigning value when going into Form Design

G

Guest

Hello, I have an access 97 application. I want to enter some modified info
when a user leaves a certain screen. The code below works when the user is
using the interface but whenever I go into Form Design it gives me a error
about 'You can't assign null to this value' and I have to close out and
reopen the application. How can I trap to not run these lines of code when
going into Form Design?

Thanks

Don

Private Sub Form_Unload(Cancel As Integer)
Me.ModifiedBY = gblSysUser
Me.ModifiedDate = VBA.Now
End Sub
 
A

Allen Browne

Form_Unload is too late to assign these values to the record in the form.

Use Form_BeforeUpdate instead.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top