Unexpected form control behaivour

jon_s

Registered User.
Local time
Today, 15:06
Joined
Jan 14, 2011
Messages
14
Hello!

I have a form with a few bound fields representing a record. In the header I have an unbound checkbox (which has no function as of yet). The form has the OnOpen-code below
Code:
Private Sub Form_Open(Cancel As Integer)
    MsgBox "Form_Open occured"
    Form_frmEditUser.chbIncludeArchivedUsers.Value = False
End Sub
to give the checkbox a well defined value when the window is opened.

If I open the form directly as "Form view", the checkbox is cleared when the window is opened. However, if I first open the window in "Design mode" and then change to "Form mode", the checkbox's "V"-surface turns into a chessboard (I think it represent "NULL". The control is not diabled).

Any ideas or explanations for this? I use access 2003
 
And do NOT use this syntax:

Form_frmEditUser

use

Forms!frmEditUser

as Form_frmEditUser can cause unintended side-effects.
 
Thanks!

Using OnLoad solved the problem.

Also thanks for the Forms!-tip
 
A major drawback when using "Forms!frmMa...." is that autocomplete stops to function (Ctrl+Space).

Do I possibly have a misconfigured Access installation?
 
Writing it this way
Code:
Forms("frmEditUser")[COLOR=Red].[/COLOR]chbIncludeArchivedUsers
will bring up intellisense. However, it will not show the fields or control names associated with that form.

If you're referring to same form, just use
Code:
Me[COLOR=Red].[/COLOR]chbIncludeArchivedUsers
 
A major drawback when using "Forms!frmMa...." is that autocomplete stops to function (Ctrl+Space).

It works for me. When referring to a form outside of the current code I use

Forms!MyForm

and the minute I put the dot after MyForm Intellisense pops right up. If you use a BANG after MyForm, intellisense will NOT show up and therefore autocomplete won't work either. It has to be

Forms!MyForm.Something
 

Users who are viewing this thread

Back
Top Bottom