Checking if form is in Design Mode.

G

Guest

Hello, I'm setting some field in the unload event of the access 97 form.
This works fine when running it but if I ever go into Design Mode it gives me
an error and I need to restart. It gives me an error

Run-Time error '2448'. You can't assign a value to this object.

Is there any way to check if the appliation is in design mode

Form_Unload
''Add code here that says if in design mode don't do two lines below.
Me.ModifiedBY = gblSysUser
Me.ModifiedDate = VBA.Now

Thanks

Don
 
G

Guest

You can use the property currentview

The CurrentView property uses the following settings.

Setting Form Displayed In: Data Access Page Displayed In:
0 Design view Design view
1 Form view Page view
2 Datasheet view Not applicable

Note This property is available only by using a macro or Visual Basic and
is read-only in all views.

e.g. : ?forms("Form1").CurrentView

- Raoul
 

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