run-time error 2455? (1 Viewer)

cyberpac9

Registered User.
Local time
Today, 09:26
Joined
Jun 6, 2005
Messages
70
I have a Switchboard form that gives the visitor several options from which to choose. All work fine except one.

The one in question loads just fine. This form has an unbound combo box used to search the database. When the user selects an option from the combo box the subform is then populated with the information. All of this works fine. The problem arises if the user tries to close Access (not the form, but rather closing out Access). We get a "run-time error 2455: you entered an expression that has an invlid reference to the property form/report". I've tried clicking on Debug, but Access closes and I cannot see what is causing the error.

Like I said, the other forms work. If instead the user opens another form from the Switchboard and then closes Access, there are no problems - it closes like it should. The error only occurs for this form and only when Access is being closed, not the form.

Anyone have any ideas how I can trap this or how to stop it?

Thanks.
 

KenHigg

Registered User
Local time
Today, 09:26
Joined
Jun 9, 2004
Messages
13,327
Have you tried to scratch build a new one?


Sometimes thats the only hope :eek:
 

cyberpac9

Registered User.
Local time
Today, 09:26
Joined
Jun 6, 2005
Messages
70
no....one reason is because i don't know if it is in the way i designed the forms...if it is, then rebuilding would have the same result...
 

KenHigg

Registered User
Local time
Today, 09:26
Joined
Jun 9, 2004
Messages
13,327
Hum...

Maybe you create a copy of the form and start removing bit's and pcs until the error goes away. Then you'd have a starting point to begin trouble shooting at (?)
 

ghudson

Registered User.
Local time
Today, 09:26
Joined
Jun 8, 2002
Messages
6,195
Is that form "in question" still open when Access tries to close?

Can you close form "in question"without any problems?
 

cyberpac9

Registered User.
Local time
Today, 09:26
Joined
Jun 6, 2005
Messages
70
ghudson said:
Is that form "in question" still open when Access tries to close?

Can you close form "in question"without any problems?

yes, it is still open...if the form is closed everything works fine...if, however, the user tries to close Access all together, that's when the run-time error occurs. like i said, with the other forms on the switchboard the user can close Access with no problems.....only this one....that's why i'm baffled.
 

cyberpac9

Registered User.
Local time
Today, 09:26
Joined
Jun 6, 2005
Messages
70
on the main form in question, i have vba code in the "Form_resize()" which lines up the combo box and the subform and corresponding labels....it appears as though it first is trying to resize the forms...could this be what is causing the error? would closing Access cause the form to call up the "Form_Resize()" function? if it is, how would i trap this since i'm closing Access?

just a thought....
 

ghudson

Registered User.
Local time
Today, 09:26
Joined
Jun 8, 2002
Messages
6,195
Something is being triggered when the form is being closed. Check for any code in the forms OnClose or UnLoad events or BeforeUpdate event [etc.]
 

cyberpac9

Registered User.
Local time
Today, 09:26
Joined
Jun 6, 2005
Messages
70
there is code in the Form_Load() and Form_Resize() - both of which are on the main form and not the subform.

the Form_Load() sets the recordsource for the subform. the Form_Resize() sets the size of the subform and positions the combo box based on the users screen size. the only other code is in the combo box AfterUpdate()...here's that code:
Code:
[B]Private Sub cbo4_AfterUpdate()[/B]
    ' Find the record that matches the control.
    Dim Rs As Object

    Set Rs = Me.Recordset.Clone
    Rs.Find "[type_id] = '" & Me![cbo4] & "'"
    If Not Rs.EOF Then Me.Bookmark = Rs.Bookmark
    
    listing.Form.RecordsetClone.Requery

    listing.Visible = True
[B]End Sub[/B]
 

ghudson

Registered User.
Local time
Today, 09:26
Joined
Jun 8, 2002
Messages
6,195
Can you post a stripped down version of your db? Just the parts that give you the error when you close access with the offending form [and subform] open.
 

cyberpac9

Registered User.
Local time
Today, 09:26
Joined
Jun 6, 2005
Messages
70
i can try...the tables are in mssql and i use access as the frontend....when you export the tables from mssql to access it changes the table names...i'll see if i can export them and post it here...most likely tomorrow...
 

cyberpac9

Registered User.
Local time
Today, 09:26
Joined
Jun 6, 2005
Messages
70
here are the forms in question (without tables)...maybe from the forms you can determine what is going on....can't post the tables, sorry...
 

Attachments

  • db2.zip
    16.8 KB · Views: 160

ghudson

Registered User.
Local time
Today, 09:26
Joined
Jun 8, 2002
Messages
6,195
The forms are not opening because the forms are linked to non existant tables.

You have to post the db with the tables that are feeding the forms. Just delete all of the records in each table and key a couple of dummy records.
 

cyberpac9

Registered User.
Local time
Today, 09:26
Joined
Jun 6, 2005
Messages
70
i was hoping that by looking at the code that goes along with the forms would help....i doubt it has anything to do with the data in the tables...i tried importing the tables but problems arise because i'm using functions that are available via MSSQL and not Access (remember, i'm using Access as the frontend)....thus, even when i go through and change table names from "dbo.whatever" to "whatever", the forms still will not work because of the functions i have used....is it possible at all to look at the forms and the VBA associated with them to decipher what might be causing the problems?
 

ghudson

Registered User.
Local time
Today, 09:26
Joined
Jun 8, 2002
Messages
6,195
The only things I noticed...

The tbl_class_listing form does not have any active code.

The tbl_list_class_type1 form does not have any code that fires when the form is closed.

The Form_Resize() function in the tbl_list_class_type1 is not being called "anywhere".

You are not closing your record set in the Combo4_AfterUpdate() sub. You should end that procedure with Rs = Nothing

Without seeing the db in action that is all that I can offer.

HTH
 

cyberpac9

Registered User.
Local time
Today, 09:26
Joined
Jun 6, 2005
Messages
70
ghudson said:
The only things I noticed...

The tbl_class_listing form does not have any active code.
exactly and it shouldn't have any...it's all accomplished from the combobox...


ghudson said:
The tbl_list_class_type1 form does not have any code that fires when the form is closed.
and it shouldn't....the form that opened it remains open...this is one of the reasons i'm baffled....no code, yet there is a problem...


ghudson said:
The Form_Resize() function in the tbl_list_class_type1 is not being called "anywhere".
not exactly....the form is maximized when loaded...if the user changes this size, thus calling form_resize(), it centers the combobox and adjusts the subform....


ghudson said:
You are not closing your record set in the Combo4_AfterUpdate() sub. You should end that procedure with Rs = Nothing
i'll look at that, good point....


ghudson said:
Without seeing the db in action that is all that I can offer.

HTH
it does, in a way....you have noticed the same things i've noticed...still hasn't really solved my problem, but at least i know i'm not going crazy....
 

Users who are viewing this thread

Top Bottom