Migrating a front end to SQL Server

  • Thread starter Thread starter Jim Bunton
  • Start date Start date
J

Jim Bunton

Access 97, Win 2000

Have a form with several subforms.
Works fine with tables linked to an Access Back End

Now linked to an SQL Server BackEnd

Form RestaurantMenus opens fine
BUT on clicking an entry in a combo which selects a record
This line of code:-
Forms!RestaurantMenus!R_OpeningHours.Form!TaRetSame.Caption = "Ta<>Re"
gives the error:-
2467
The expression you entered refers to an object that is closed or doesn't exist.@For example, you may have assigned a form to a Form object variable, closed the form, and then referred to the object variable.@@1@@1--

NB
RestaurantMenus!R_OpeningHours.Form!TaRetSame.Caption
Main Form Name!SubFormName SubForm Control
and strangely!
this line of code which precedes the failing one
Forms!RestaurantMenus!RestaurantMenuItemGroups.Form.Requery
does not cause an error



Jim Bunton
 
Jim said:
Access 97, Win 2000

Have a form with several subforms.
Works fine with tables linked to an Access Back End

Now linked to an SQL Server BackEnd

Form RestaurantMenus opens fine
BUT on clicking an entry in a combo which selects a record
This line of code:-
Forms!RestaurantMenus!R_OpeningHours.Form!TaRetSame.Caption = "Ta<>Re"
gives the error:-
2467
The expression you entered refers to an object that is closed or
doesn't exist.@For example, you may have assigned a form to a Form
object variable, closed the form, and then referred to the object
variable.@@1@@1--

NB
RestaurantMenus!R_OpeningHours.Form!TaRetSame.Caption
Main Form Name!SubFormName SubForm Control
and strangely!
this line of code which precedes the failing one
Forms!RestaurantMenus!RestaurantMenuItemGroups.Form.Requery
does not cause an error

I can think of know reason why a line of code that refers to a form control
could possibly be affected by what kind of back end is being used. I
suspect that your move to SQL Server has nothing to do with this.

The two lines refer to two different subform controls so the fact that one
rasises an error and the other doesn't suggests that the one that fails is
incorrect. Or perhpas the form is corrupted.
 
Rick
Thanks for the reply.
Ok - I've done the obvious - copied the sub form over from the access linked
on thta's working.

You were right - the one (also copied from the same source as above) must
have got corrupted.

Now it works fine (if a little more slowly!). Thanks for agreeing - no known
cause - it did prompt the approproate action. No excuses really but I can't
for the life of me see how it became corrupted.

Thanks again
Jim
 
Back
Top