Error when Navigation bar not loaded

G

Guest

"2455 you entered an expression that has an invalid reference to the
property form/report"

|I get this error if I close teh database with a screen open adn the Nav bar
not loaded - Access Options.

If I change the options to show the nav bar the error does not occur.

How can I stop this error - I need to hide the nav bar.

Thanks

lou
 
A

Allen Browne

In what context do you get this error?

I tried unchecking the option for the Navigation Pane for the current
database, and restarted. I then opened Form1 like this:
DoCmd.OpenForm "Form1"
and then tries:
? Forms!frmClient.Form.Name

It worked without error, so I guess you must be doing something else.
 
G

Guest

Yes Allen

I have discovered that the error only occurs after this button (see code
below) has been used to change the displayed records in the (just for
background:the form has three forms frm1 the mainform, frm2 the subform or
frm1 adn frm3 the subform of frm2.)

Any ideas why?

Private Sub btnSelectCase_Click()
'Click to make CboSeletCase combo appear

On Error GoTo CCError

cboSelectCase.SetFocus
cboSelectCase.Dropdown
Exit Sub

CCError:
MsgBox Err.Number & " " & Err.Description
Resume Next

End Sub

Private Sub cboSelectCase_AfterUpdate()
'Combo to select and display an existing case.
'Always displays section 1

On Error GoTo CCError

CCRequeryCaseSubforms Me


CCHighlightSection Me.btnPastReq
CCInactiveSection Me.btnFuture
CCInactiveSection Me.btnEq
CCInactiveSection Me.btnReport

DoCmd.SearchForRecord , "", acFirst, "[C_ID] = " &
Str(Nz(Screen.ActiveControl, 0))
Me.Form![frmC_Options].Form.RecordSource = "qryCOPast_Section"


Me.[frmC_Options].Form.Visible = True
lngSection = 1 ' so section can be set on a c option new record later
'and correct requery performed
Me.frmC_Options.Form!C_Section.DefaultValue = 1

Exit Sub

CCError:
MsgBox Err.Number & " " & Err.Description
Resume Next

End Sub
 
A

Allen Browne

Okay: it's not related to the NavPane then.

When you first open the form, one subform must load before the others. If
you code something that refers to the other subform before it loads, you can
get this error.

Similarly if you unload the subform (clearing the SourceObject of the
subform control), you can get this error.

You can also get it if you close the default workspace (a fairly common
programming error after using a transaction.)

There are probably other triggers as well. You have other code involved
here, such as CCRequeryCaseSubforms. It will probably take you some work to
track this down and debug what's going wrong.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Louverril said:
Yes Allen

I have discovered that the error only occurs after this button (see code
below) has been used to change the displayed records in the (just for
background:the form has three forms frm1 the mainform, frm2 the subform or
frm1 adn frm3 the subform of frm2.)

Any ideas why?

Private Sub btnSelectCase_Click()
'Click to make CboSeletCase combo appear

On Error GoTo CCError

cboSelectCase.SetFocus
cboSelectCase.Dropdown
Exit Sub

CCError:
MsgBox Err.Number & " " & Err.Description
Resume Next

End Sub

Private Sub cboSelectCase_AfterUpdate()
'Combo to select and display an existing case.
'Always displays section 1

On Error GoTo CCError

CCRequeryCaseSubforms Me


CCHighlightSection Me.btnPastReq
CCInactiveSection Me.btnFuture
CCInactiveSection Me.btnEq
CCInactiveSection Me.btnReport

DoCmd.SearchForRecord , "", acFirst, "[C_ID] = " &
Str(Nz(Screen.ActiveControl, 0))
Me.Form![frmC_Options].Form.RecordSource = "qryCOPast_Section"


Me.[frmC_Options].Form.Visible = True
lngSection = 1 ' so section can be set on a c option new record later
'and correct requery performed
Me.frmC_Options.Form!C_Section.DefaultValue = 1

Exit Sub

CCError:
MsgBox Err.Number & " " & Err.Description
Resume Next

End Sub




Louverril said:
"2455 you entered an expression that has an invalid reference to the
property form/report"

|I get this error if I close teh database with a screen open adn the Nav
bar
not loaded - Access Options.

If I change the options to show the nav bar the error does not occur.

How can I stop this error - I need to hide the nav bar.

Thanks

lou
 
G

Guest

Allen

"Okay: it's not related to the NavPane then. "

So why does it ONLY occur when the Nav Pan has been disabled?

And only when the database is closed from the top right button?

Admittedly it only does this after you've used the combo box but ONLY if the
nav panes not there and you close the whole database before the form.

How can I debug when I have to close teh database to get the error. I can't
catch it?

Lou




Allen Browne said:
Okay: it's not related to the NavPane then.

When you first open the form, one subform must load before the others. If
you code something that refers to the other subform before it loads, you can
get this error.

Similarly if you unload the subform (clearing the SourceObject of the
subform control), you can get this error.

You can also get it if you close the default workspace (a fairly common
programming error after using a transaction.)

There are probably other triggers as well. You have other code involved
here, such as CCRequeryCaseSubforms. It will probably take you some work to
track this down and debug what's going wrong.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Louverril said:
Yes Allen

I have discovered that the error only occurs after this button (see code
below) has been used to change the displayed records in the (just for
background:the form has three forms frm1 the mainform, frm2 the subform or
frm1 adn frm3 the subform of frm2.)

Any ideas why?

Private Sub btnSelectCase_Click()
'Click to make CboSeletCase combo appear

On Error GoTo CCError

cboSelectCase.SetFocus
cboSelectCase.Dropdown
Exit Sub

CCError:
MsgBox Err.Number & " " & Err.Description
Resume Next

End Sub

Private Sub cboSelectCase_AfterUpdate()
'Combo to select and display an existing case.
'Always displays section 1

On Error GoTo CCError

CCRequeryCaseSubforms Me


CCHighlightSection Me.btnPastReq
CCInactiveSection Me.btnFuture
CCInactiveSection Me.btnEq
CCInactiveSection Me.btnReport

DoCmd.SearchForRecord , "", acFirst, "[C_ID] = " &
Str(Nz(Screen.ActiveControl, 0))
Me.Form![frmC_Options].Form.RecordSource = "qryCOPast_Section"


Me.[frmC_Options].Form.Visible = True
lngSection = 1 ' so section can be set on a c option new record later
'and correct requery performed
Me.frmC_Options.Form!C_Section.DefaultValue = 1

Exit Sub

CCError:
MsgBox Err.Number & " " & Err.Description
Resume Next

End Sub




Louverril said:
"2455 you entered an expression that has an invalid reference to the
property form/report"

|I get this error if I close teh database with a screen open adn the Nav
bar
not loaded - Access Options.

If I change the options to show the nav bar the error does not occur.

How can I stop this error - I need to hide the nav bar.

Thanks

lou
 
A

Allen Browne

You don't have to close the database to get the nav pane.
Just press F11.

Or Alt+F11 if you want to open the code window for debugging.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Louverril said:
Allen

"Okay: it's not related to the NavPane then. "

So why does it ONLY occur when the Nav Pan has been disabled?

And only when the database is closed from the top right button?

Admittedly it only does this after you've used the combo box but ONLY if
the
nav panes not there and you close the whole database before the form.

How can I debug when I have to close teh database to get the error. I
can't
catch it?

Lou




Allen Browne said:
Okay: it's not related to the NavPane then.

When you first open the form, one subform must load before the others. If
you code something that refers to the other subform before it loads, you
can
get this error.

Similarly if you unload the subform (clearing the SourceObject of the
subform control), you can get this error.

You can also get it if you close the default workspace (a fairly common
programming error after using a transaction.)

There are probably other triggers as well. You have other code involved
here, such as CCRequeryCaseSubforms. It will probably take you some work
to
track this down and debug what's going wrong.

Louverril said:
Yes Allen

I have discovered that the error only occurs after this button (see
code
below) has been used to change the displayed records in the (just for
background:the form has three forms frm1 the mainform, frm2 the subform
or
frm1 adn frm3 the subform of frm2.)

Any ideas why?

Private Sub btnSelectCase_Click()
'Click to make CboSeletCase combo appear

On Error GoTo CCError

cboSelectCase.SetFocus
cboSelectCase.Dropdown
Exit Sub

CCError:
MsgBox Err.Number & " " & Err.Description
Resume Next

End Sub

Private Sub cboSelectCase_AfterUpdate()
'Combo to select and display an existing case.
'Always displays section 1

On Error GoTo CCError

CCRequeryCaseSubforms Me


CCHighlightSection Me.btnPastReq
CCInactiveSection Me.btnFuture
CCInactiveSection Me.btnEq
CCInactiveSection Me.btnReport

DoCmd.SearchForRecord , "", acFirst, "[C_ID] = " &
Str(Nz(Screen.ActiveControl, 0))
Me.Form![frmC_Options].Form.RecordSource = "qryCOPast_Section"


Me.[frmC_Options].Form.Visible = True
lngSection = 1 ' so section can be set on a c option new record
later
'and correct requery performed
Me.frmC_Options.Form!C_Section.DefaultValue = 1

Exit Sub

CCError:
MsgBox Err.Number & " " & Err.Description
Resume Next

End Sub




:

"2455 you entered an expression that has an invalid reference to the
property form/report"

|I get this error if I close teh database with a screen open adn the
Nav
bar
not loaded - Access Options.

If I change the options to show the nav bar the error does not occur.

How can I stop this error - I need to hide the nav bar.
 
G

Guest

You are misunderstanding me.

I don't want the nav pane - that's my problem. I want the user to never see
the nav pane. OR have it just "shrunk" at the side (this is what F11 does).

So I uncheck the nav pane from the Access Options - as described earlier.

There is nothing wrong with doing this.

However

1: with the database loaded in this condition.
2: the form in question loaded
3: The combo button has been used
4: Close the database with the form in question still open
5: I get this error.

I HAVE to close the database to get the error

Thanks,
Lou

Allen Browne said:
You don't have to close the database to get the nav pane.
Just press F11.

Or Alt+F11 if you want to open the code window for debugging.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Louverril said:
Allen

"Okay: it's not related to the NavPane then. "

So why does it ONLY occur when the Nav Pan has been disabled?

And only when the database is closed from the top right button?

Admittedly it only does this after you've used the combo box but ONLY if
the
nav panes not there and you close the whole database before the form.

How can I debug when I have to close teh database to get the error. I
can't
catch it?

Lou




Allen Browne said:
Okay: it's not related to the NavPane then.

When you first open the form, one subform must load before the others. If
you code something that refers to the other subform before it loads, you
can
get this error.

Similarly if you unload the subform (clearing the SourceObject of the
subform control), you can get this error.

You can also get it if you close the default workspace (a fairly common
programming error after using a transaction.)

There are probably other triggers as well. You have other code involved
here, such as CCRequeryCaseSubforms. It will probably take you some work
to
track this down and debug what's going wrong.

Yes Allen

I have discovered that the error only occurs after this button (see
code
below) has been used to change the displayed records in the (just for
background:the form has three forms frm1 the mainform, frm2 the subform
or
frm1 adn frm3 the subform of frm2.)

Any ideas why?

Private Sub btnSelectCase_Click()
'Click to make CboSeletCase combo appear

On Error GoTo CCError

cboSelectCase.SetFocus
cboSelectCase.Dropdown
Exit Sub

CCError:
MsgBox Err.Number & " " & Err.Description
Resume Next

End Sub

Private Sub cboSelectCase_AfterUpdate()
'Combo to select and display an existing case.
'Always displays section 1

On Error GoTo CCError

CCRequeryCaseSubforms Me


CCHighlightSection Me.btnPastReq
CCInactiveSection Me.btnFuture
CCInactiveSection Me.btnEq
CCInactiveSection Me.btnReport

DoCmd.SearchForRecord , "", acFirst, "[C_ID] = " &
Str(Nz(Screen.ActiveControl, 0))
Me.Form![frmC_Options].Form.RecordSource = "qryCOPast_Section"


Me.[frmC_Options].Form.Visible = True
lngSection = 1 ' so section can be set on a c option new record
later
'and correct requery performed
Me.frmC_Options.Form!C_Section.DefaultValue = 1

Exit Sub

CCError:
MsgBox Err.Number & " " & Err.Description
Resume Next

End Sub




:

"2455 you entered an expression that has an invalid reference to the
property form/report"

|I get this error if I close teh database with a screen open adn the
Nav
bar
not loaded - Access Options.

If I change the options to show the nav bar the error does not occur.

How can I stop this error - I need to hide the nav bar.
 
G

Guest

Did you realise also that you cannot use the list items edit form feature on
combo's if you don't have the navbar showing - not just retracted actually
set to not show in the access options?

Having teh navbar not show seems to cause a lot of problems

Lou


Allen Browne said:
You don't have to close the database to get the nav pane.
Just press F11.

Or Alt+F11 if you want to open the code window for debugging.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Louverril said:
Allen

"Okay: it's not related to the NavPane then. "

So why does it ONLY occur when the Nav Pan has been disabled?

And only when the database is closed from the top right button?

Admittedly it only does this after you've used the combo box but ONLY if
the
nav panes not there and you close the whole database before the form.

How can I debug when I have to close teh database to get the error. I
can't
catch it?

Lou




Allen Browne said:
Okay: it's not related to the NavPane then.

When you first open the form, one subform must load before the others. If
you code something that refers to the other subform before it loads, you
can
get this error.

Similarly if you unload the subform (clearing the SourceObject of the
subform control), you can get this error.

You can also get it if you close the default workspace (a fairly common
programming error after using a transaction.)

There are probably other triggers as well. You have other code involved
here, such as CCRequeryCaseSubforms. It will probably take you some work
to
track this down and debug what's going wrong.

Yes Allen

I have discovered that the error only occurs after this button (see
code
below) has been used to change the displayed records in the (just for
background:the form has three forms frm1 the mainform, frm2 the subform
or
frm1 adn frm3 the subform of frm2.)

Any ideas why?

Private Sub btnSelectCase_Click()
'Click to make CboSeletCase combo appear

On Error GoTo CCError

cboSelectCase.SetFocus
cboSelectCase.Dropdown
Exit Sub

CCError:
MsgBox Err.Number & " " & Err.Description
Resume Next

End Sub

Private Sub cboSelectCase_AfterUpdate()
'Combo to select and display an existing case.
'Always displays section 1

On Error GoTo CCError

CCRequeryCaseSubforms Me


CCHighlightSection Me.btnPastReq
CCInactiveSection Me.btnFuture
CCInactiveSection Me.btnEq
CCInactiveSection Me.btnReport

DoCmd.SearchForRecord , "", acFirst, "[C_ID] = " &
Str(Nz(Screen.ActiveControl, 0))
Me.Form![frmC_Options].Form.RecordSource = "qryCOPast_Section"


Me.[frmC_Options].Form.Visible = True
lngSection = 1 ' so section can be set on a c option new record
later
'and correct requery performed
Me.frmC_Options.Form!C_Section.DefaultValue = 1

Exit Sub

CCError:
MsgBox Err.Number & " " & Err.Description
Resume Next

End Sub




:

"2455 you entered an expression that has an invalid reference to the
property form/report"

|I get this error if I close teh database with a screen open adn the
Nav
bar
not loaded - Access Options.

If I change the options to show the nav bar the error does not occur.

How can I stop this error - I need to hide the nav bar.
 
A

Allen Browne

Again, I am not able to reproduce the behavior you describe.

Right-clicking a combo that has its Edit List property set to another form
opens that form fine, even without the NavPane showing.

Clearly something else is going on in your database, but I don't think I
have anything further to contribute to this thread.
 
G

Guest

Sorry Allen but yopu still haven't understood - I am not being clear! !

1. Set Access options to not display nav bar
2. reopen database
3.open form with the combo box code in I posted.
4. Click (not right just as normal - left) the combo box and pick a new
record.
5. See the new record displayed.
5a DON'T close the form.
6. Click the very top X to close the database.
7. I get the error.

If you HAVENT USED the combo box you don't get the error. You get no errors
using the comobo box, the error only apppears when you close the database.

Again I get no errors in ANY other curcumstance.

Honsstly \I think this is worth looking at - there are strnage things
happening when you don't have the nav bar showing.

Lou
 
G

Guest

Couldn't get an answer to this - seemed to be some disbelief that it actually
occured. BUT for fellow suffers it did and the PROBLEM I tracked down to teh
onload event - for some reason this runs when you close a database for the
current open form.

The SOLUTION is to move the load code into the open event - if you can.
 

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