runtime after upgrading

  • Thread starter Thread starter Jacco
  • Start date Start date
J

Jacco

Hi everyone, I recently upped my MS Access from 2000 to 2003. Previously I
put a lot of effort in some coding, which now stopped working by a runtime
error (2447) Illegal use of . (dot) or !

Any help is appreciated..

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Len([Text71]) > 4 Then
[Text71].FontSize = 6
Else
[Text71].FontSize = 9
End If
If Len([Text72]) > 4 Then
[Text72].FontSize = 6
Else
[Text72].FontSize = 9
End If
End Sub

Thanks,
Jacco
 
Try using Me![Text71] and Me![Text72] (or is it Me.[Text71] and
Me.[Text72]?) instead of simply referring to the control name.
 
I tried both with ! and with . (dot), but I still get the same error. I just
don't understand it... Did I misunderstand where to put these?? I tried
every combination..

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Len(Me![Text71]) > 4 Then
Me![Text71].FontSize = 6
Else
Me![Text71].FontSize = 9
End If
End Sub

My complete script looks like this:

Option Compare Database
Option Explicit
Public MPSum As Double
Public MPPage As Double
Public DurationSum As Double
Public DurationPage As Double
Public ToNightPage As Double
Public LaNightPage As Double
Public ToDayPage As Double
Public LaDayPage As Double
Public ToNightSum As Double
Public LaNightSum As Double
Public ToDaySum As Double
Public LaDaySum As Double
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Len([Text71]) > 4 Then
[Text71].FontSize = 6
Else
[Text71].FontSize = 9
End If
If Len([Text72]) > 4 Then
[Text72].FontSize = 6
Else
[Text72].FontSize = 9
End If
If Len([Text74]) > 4 Then
[Text74].FontSize = 6
Else
[Text74].FontSize = 9
End If
If Len([Text75]) > 4 Then
[Text75].FontSize = 6
Else
[Text75].FontSize = 9
End If
If Len([Text77]) > 4 Then
[Text77].FontSize = 6
Else
[Text77].FontSize = 9
End If
If Len([Text78]) > 4 Then
[Text78].FontSize = 6
Else
[Text78].FontSize = 9
End If
If Len([Text80]) > 4 Then
[Text80].FontSize = 6
Else
[Text80].FontSize = 9
End If
If Len([Text81]) > 4 Then
[Text81].FontSize = 6
Else
[Text81].FontSize = 9
End If
End Sub
Private Sub Detail_Print(Cancel As Integer, FormatCount As Integer)
MPSum = MPSum + Reports![Jar_Jeppesen_L]![MP]
MPPage = MPPage + Reports![Jar_Jeppesen_L]![MP]
DurationSum = DurationSum + Reports![Jar_Jeppesen_L]![Duration]
DurationPage = DurationPage + Reports![Jar_Jeppesen_L]![Duration]
ToNightSum = ToNightSum + Reports![Jar_Jeppesen_L]![tonight]
ToNightPage = ToNightPage + Reports![Jar_Jeppesen_L]![tonight]
ToDaySum = ToDaySum + Reports![Jar_Jeppesen_L]![today]
ToDayPage = ToDayPage + Reports![Jar_Jeppesen_L]![today]
LaNightSum = LaNightSum + Reports![Jar_Jeppesen_L]![LandNight]
LaNightPage = LaNightPage + Reports![Jar_Jeppesen_L]![LandNight]
LaDaySum = LaDaySum + Reports![Jar_Jeppesen_L]![LandDay]
LaDayPage = LaDayPage + Reports![Jar_Jeppesen_L]![LandDay]
End Sub
Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)
' reset the counter for each new page
MPPage = 0
DurationPage = 0
ToDayPage = 0
ToNightPage = 0
LaDayPage = 0
LaNightPage = 0
End Sub



Douglas J. Steele said:
Try using Me![Text71] and Me![Text72] (or is it Me.[Text71] and
Me.[Text72]?) instead of simply referring to the control name.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Jacco said:
Hi everyone, I recently upped my MS Access from 2000 to 2003. Previously
I put a lot of effort in some coding, which now stopped working by a
runtime error (2447) Illegal use of . (dot) or !

Any help is appreciated..

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Len([Text71]) > 4 Then
[Text71].FontSize = 6
Else
[Text71].FontSize = 9
End If
If Len([Text72]) > 4 Then
[Text72].FontSize = 6
Else
[Text72].FontSize = 9
End If
End Sub

Thanks,
Jacco
 
do you have the same References ?
Open some code and point to Tools - References.


Jacco said:
I tried both with ! and with . (dot), but I still get the same error. I just
don't understand it... Did I misunderstand where to put these?? I tried
every combination..

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Len(Me![Text71]) > 4 Then
Me![Text71].FontSize = 6
Else
Me![Text71].FontSize = 9
End If
End Sub

My complete script looks like this:

Option Compare Database
Option Explicit
Public MPSum As Double
Public MPPage As Double
Public DurationSum As Double
Public DurationPage As Double
Public ToNightPage As Double
Public LaNightPage As Double
Public ToDayPage As Double
Public LaDayPage As Double
Public ToNightSum As Double
Public LaNightSum As Double
Public ToDaySum As Double
Public LaDaySum As Double
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Len([Text71]) > 4 Then
[Text71].FontSize = 6
Else
[Text71].FontSize = 9
End If
If Len([Text72]) > 4 Then
[Text72].FontSize = 6
Else
[Text72].FontSize = 9
End If
If Len([Text74]) > 4 Then
[Text74].FontSize = 6
Else
[Text74].FontSize = 9
End If
If Len([Text75]) > 4 Then
[Text75].FontSize = 6
Else
[Text75].FontSize = 9
End If
If Len([Text77]) > 4 Then
[Text77].FontSize = 6
Else
[Text77].FontSize = 9
End If
If Len([Text78]) > 4 Then
[Text78].FontSize = 6
Else
[Text78].FontSize = 9
End If
If Len([Text80]) > 4 Then
[Text80].FontSize = 6
Else
[Text80].FontSize = 9
End If
If Len([Text81]) > 4 Then
[Text81].FontSize = 6
Else
[Text81].FontSize = 9
End If
End Sub
Private Sub Detail_Print(Cancel As Integer, FormatCount As Integer)
MPSum = MPSum + Reports![Jar_Jeppesen_L]![MP]
MPPage = MPPage + Reports![Jar_Jeppesen_L]![MP]
DurationSum = DurationSum + Reports![Jar_Jeppesen_L]![Duration]
DurationPage = DurationPage + Reports![Jar_Jeppesen_L]![Duration]
ToNightSum = ToNightSum + Reports![Jar_Jeppesen_L]![tonight]
ToNightPage = ToNightPage + Reports![Jar_Jeppesen_L]![tonight]
ToDaySum = ToDaySum + Reports![Jar_Jeppesen_L]![today]
ToDayPage = ToDayPage + Reports![Jar_Jeppesen_L]![today]
LaNightSum = LaNightSum + Reports![Jar_Jeppesen_L]![LandNight]
LaNightPage = LaNightPage + Reports![Jar_Jeppesen_L]![LandNight]
LaDaySum = LaDaySum + Reports![Jar_Jeppesen_L]![LandDay]
LaDayPage = LaDayPage + Reports![Jar_Jeppesen_L]![LandDay]
End Sub
Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)
' reset the counter for each new page
MPPage = 0
DurationPage = 0
ToDayPage = 0
ToNightPage = 0
LaDayPage = 0
LaNightPage = 0
End Sub



Douglas J. Steele said:
Try using Me![Text71] and Me![Text72] (or is it Me.[Text71] and
Me.[Text72]?) instead of simply referring to the control name.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Jacco said:
Hi everyone, I recently upped my MS Access from 2000 to 2003. Previously
I put a lot of effort in some coding, which now stopped working by a
runtime error (2447) Illegal use of . (dot) or !

Any help is appreciated..

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Len([Text71]) > 4 Then
[Text71].FontSize = 6
Else
[Text71].FontSize = 9
End If
If Len([Text72]) > 4 Then
[Text72].FontSize = 6
Else
[Text72].FontSize = 9
End If
End Sub

Thanks,
Jacco
 
Besides the fact that now my data objects is version 11 instead of 10 (what
it used to be).. it appears so. Both use VB6...

ph said:
do you have the same References ?
Open some code and point to Tools - References.


Jacco said:
I tried both with ! and with . (dot), but I still get the same error. I
just
don't understand it... Did I misunderstand where to put these?? I tried
every combination..

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Len(Me![Text71]) > 4 Then
Me![Text71].FontSize = 6
Else
Me![Text71].FontSize = 9
End If
End Sub

My complete script looks like this:

Option Compare Database
Option Explicit
Public MPSum As Double
Public MPPage As Double
Public DurationSum As Double
Public DurationPage As Double
Public ToNightPage As Double
Public LaNightPage As Double
Public ToDayPage As Double
Public LaDayPage As Double
Public ToNightSum As Double
Public LaNightSum As Double
Public ToDaySum As Double
Public LaDaySum As Double
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Len([Text71]) > 4 Then
[Text71].FontSize = 6
Else
[Text71].FontSize = 9
End If
If Len([Text72]) > 4 Then
[Text72].FontSize = 6
Else
[Text72].FontSize = 9
End If
If Len([Text74]) > 4 Then
[Text74].FontSize = 6
Else
[Text74].FontSize = 9
End If
If Len([Text75]) > 4 Then
[Text75].FontSize = 6
Else
[Text75].FontSize = 9
End If
If Len([Text77]) > 4 Then
[Text77].FontSize = 6
Else
[Text77].FontSize = 9
End If
If Len([Text78]) > 4 Then
[Text78].FontSize = 6
Else
[Text78].FontSize = 9
End If
If Len([Text80]) > 4 Then
[Text80].FontSize = 6
Else
[Text80].FontSize = 9
End If
If Len([Text81]) > 4 Then
[Text81].FontSize = 6
Else
[Text81].FontSize = 9
End If
End Sub
Private Sub Detail_Print(Cancel As Integer, FormatCount As Integer)
MPSum = MPSum + Reports![Jar_Jeppesen_L]![MP]
MPPage = MPPage + Reports![Jar_Jeppesen_L]![MP]
DurationSum = DurationSum + Reports![Jar_Jeppesen_L]![Duration]
DurationPage = DurationPage + Reports![Jar_Jeppesen_L]![Duration]
ToNightSum = ToNightSum + Reports![Jar_Jeppesen_L]![tonight]
ToNightPage = ToNightPage + Reports![Jar_Jeppesen_L]![tonight]
ToDaySum = ToDaySum + Reports![Jar_Jeppesen_L]![today]
ToDayPage = ToDayPage + Reports![Jar_Jeppesen_L]![today]
LaNightSum = LaNightSum + Reports![Jar_Jeppesen_L]![LandNight]
LaNightPage = LaNightPage + Reports![Jar_Jeppesen_L]![LandNight]
LaDaySum = LaDaySum + Reports![Jar_Jeppesen_L]![LandDay]
LaDayPage = LaDayPage + Reports![Jar_Jeppesen_L]![LandDay]
End Sub
Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)
' reset the counter for each new page
MPPage = 0
DurationPage = 0
ToDayPage = 0
ToNightPage = 0
LaDayPage = 0
LaNightPage = 0
End Sub



Douglas J. Steele said:
Try using Me![Text71] and Me![Text72] (or is it Me.[Text71] and
Me.[Text72]?) instead of simply referring to the control name.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Hi everyone, I recently upped my MS Access from 2000 to 2003.
Previously
I put a lot of effort in some coding, which now stopped working by a
runtime error (2447) Illegal use of . (dot) or !

Any help is appreciated..

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Len([Text71]) > 4 Then
[Text71].FontSize = 6
Else
[Text71].FontSize = 9
End If
If Len([Text72]) > 4 Then
[Text72].FontSize = 6
Else
[Text72].FontSize = 9
End If
End Sub

Thanks,
Jacco
 
Hello Jacco,
Did you resolve this issue? The same thing is occuring to my code which
worked previously. I am perplexed.
This is the line that it errors:
If Me.[Sum Of amount] = 0.01 Then x = 0
the "Me.[Sum Of amount]" is a text box on a report

Thanks


Jacco said:
Besides the fact that now my data objects is version 11 instead of 10 (what
it used to be).. it appears so. Both use VB6...

ph said:
do you have the same References ?
Open some code and point to Tools - References.


Jacco said:
I tried both with ! and with . (dot), but I still get the same error. I
just
don't understand it... Did I misunderstand where to put these?? I tried
every combination..

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Len(Me![Text71]) > 4 Then
Me![Text71].FontSize = 6
Else
Me![Text71].FontSize = 9
End If
End Sub

My complete script looks like this:

Option Compare Database
Option Explicit
Public MPSum As Double
Public MPPage As Double
Public DurationSum As Double
Public DurationPage As Double
Public ToNightPage As Double
Public LaNightPage As Double
Public ToDayPage As Double
Public LaDayPage As Double
Public ToNightSum As Double
Public LaNightSum As Double
Public ToDaySum As Double
Public LaDaySum As Double
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Len([Text71]) > 4 Then
[Text71].FontSize = 6
Else
[Text71].FontSize = 9
End If
If Len([Text72]) > 4 Then
[Text72].FontSize = 6
Else
[Text72].FontSize = 9
End If
If Len([Text74]) > 4 Then
[Text74].FontSize = 6
Else
[Text74].FontSize = 9
End If
If Len([Text75]) > 4 Then
[Text75].FontSize = 6
Else
[Text75].FontSize = 9
End If
If Len([Text77]) > 4 Then
[Text77].FontSize = 6
Else
[Text77].FontSize = 9
End If
If Len([Text78]) > 4 Then
[Text78].FontSize = 6
Else
[Text78].FontSize = 9
End If
If Len([Text80]) > 4 Then
[Text80].FontSize = 6
Else
[Text80].FontSize = 9
End If
If Len([Text81]) > 4 Then
[Text81].FontSize = 6
Else
[Text81].FontSize = 9
End If
End Sub
Private Sub Detail_Print(Cancel As Integer, FormatCount As Integer)
MPSum = MPSum + Reports![Jar_Jeppesen_L]![MP]
MPPage = MPPage + Reports![Jar_Jeppesen_L]![MP]
DurationSum = DurationSum + Reports![Jar_Jeppesen_L]![Duration]
DurationPage = DurationPage + Reports![Jar_Jeppesen_L]![Duration]
ToNightSum = ToNightSum + Reports![Jar_Jeppesen_L]![tonight]
ToNightPage = ToNightPage + Reports![Jar_Jeppesen_L]![tonight]
ToDaySum = ToDaySum + Reports![Jar_Jeppesen_L]![today]
ToDayPage = ToDayPage + Reports![Jar_Jeppesen_L]![today]
LaNightSum = LaNightSum + Reports![Jar_Jeppesen_L]![LandNight]
LaNightPage = LaNightPage + Reports![Jar_Jeppesen_L]![LandNight]
LaDaySum = LaDaySum + Reports![Jar_Jeppesen_L]![LandDay]
LaDayPage = LaDayPage + Reports![Jar_Jeppesen_L]![LandDay]
End Sub
Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)
' reset the counter for each new page
MPPage = 0
DurationPage = 0
ToDayPage = 0
ToNightPage = 0
LaDayPage = 0
LaNightPage = 0
End Sub



Try using Me![Text71] and Me![Text72] (or is it Me.[Text71] and
Me.[Text72]?) instead of simply referring to the control name.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Hi everyone, I recently upped my MS Access from 2000 to 2003.
Previously
I put a lot of effort in some coding, which now stopped working by a
runtime error (2447) Illegal use of . (dot) or !

Any help is appreciated..

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Len([Text71]) > 4 Then
[Text71].FontSize = 6
Else
[Text71].FontSize = 9
End If
If Len([Text72]) > 4 Then
[Text72].FontSize = 6
Else
[Text72].FontSize = 9
End If
End Sub

Thanks,
Jacco
 
Back
Top