Forms and Subforms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following code in my project. It has been running niecely for some
time, but suddenly it would not work anymore. I have looked so much at it
that I feel I am becoming blind. Can someone help me see what is wrong:

This is the error message I get:
Error number: -2146500594
Errod descr. Method 'Form' of object '_SubForm' failed

The pogram brakes at line 11


1 Private Sub Form_Open(Cancel As Integer)
2
3 Dim Lev As Integer
4 Dim Filter As String
5
6
7 For Lev = 1 To 10
9 Me("Lev" & Lev).SetFocus
10 Filter = "Leverandørnr = " & Lev
11 Me("delfrmInnkjopLev" & Lev).Form.Filter = Filter
12 Me("delfrmInnkjopLev" & Lev).Form.FilterOn = True
13 End If
14 Next
15 End Sub

Lev1 to Lev10 is tabs in a Tab control
Each tab contain a subform called delfrmInnkjopLev1 to delfrmInnkjopLev10
 
Tabs don't contain forms. If you've got subforms on the tabs, what are the
names of the subform containers?
 
On each tab page I have a subform.
The subforms are called delfrmInnkjopLev1 to delfrmInnkjopLev10

--
___________
Regards
JaydDe


Douglas J. Steele skrev:
Tabs don't contain forms. If you've got subforms on the tabs, what are the
names of the subform containers?
 
Darn, you did give that information in the first place: don't know how I
missed it (sorry about that!)

Nothing obvious jumps out at me. It might be worthwhile to do a decompile of
your application (see http://www.trigeminal.com/usenet/usenet004.asp for
details on this feature). Alternatively, you could try creating a new form
and copying from the original one.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


JayDe said:
On each tab page I have a subform.
The subforms are called delfrmInnkjopLev1 to delfrmInnkjopLev10

--
___________
Regards
JaydDe


Douglas J. Steele skrev:
 
Thanks for taking the time to help me.

I have now tried the decompile option. Did not work.
I have also tried to create a new form, created new controls and then copied
the code from the original form to the new form. But unfortunately I got the
same error.

I am stuck
--
___________
Regards
JaydDe


Douglas J. Steele skrev:
 
I discovered that if I copy the form and subform to another .mdb it works fine.

So something must be wrong, but what?
--
___________
Regards
JaydDe


JayDe skrev:
 
Back
Top