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
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