"There is an invalid use of the . or !" -version problem

L

Laurel

I have an application which behaves differently on a machine with one
version of Access/VB than on another. We don't have the option of upgrading
Access because these are machines which have been given to my son for use in
his classroom in the Boston Public Schools (classroom for "behaviorally
challenged" 7th and 8th graders) - given to him, not the school system (he's
creative that way.) He doesn't have the software, he just has what's on the
machines. I'm hoping I can modify my code so it will work on the older
version. The code in question is below. The error occurs on
[txtWeekDay]=fncWeekDay([txtScore_Date]). Control is transferred to
"gs_temp = ...." as soon as we "step into" that line. We never enter
fncWeekDay(). The code for fncWeekDay() is at the bottom of this message.
[txtWeekDay] and [txtScore_Date] are unbound text boxes with nothing defined
for Control Source.
The databases are identical. We kept refreshing it to eliminate any
possibility of looking at the wrong copy, etc.

I've examined the references as they are identical in both environments.
Well... identical as to what you see checked in the references window -
dunno about the code the references are referring to.

I would really appreciate whatever creative thinking is out there with as
little of "did you try, etc" as possible, since I'm not able to debug this
on my own. I have to walk him through the debug process over the phone, and
he's the sort who has trouble sliding windows around to do stuff like
uncovering the Database window...

The versions that work: Access-9.0.6926 SP-3 VB-6.4.9969 Forms
3:2.01
The versions that don't: Access-9.0.3821 SR-4 VB-6.4.8714 Forms
3:2.01

Private Sub txtScore_Date_AfterUpdate()

On Error GoTo Err_txtScore_Date_AfterUpdate
Me.AllowAdditions = True
Dim li_debug As Integer
li_debug = 0
[txtWeekDay] = fncWeekDay([txtScore_Date])
Call SetButtonStates
Me.AllowAdditions = False
Exit_txtScore_Date_AfterUpdate:
Exit Sub

Err_txtScore_Date_AfterUpdate:
gs_temp = "txtScore_Date_AfterUpdate: " & Err.Description
MsgBox gs_temp

Resume Exit_txtScore_Date_AfterUpdate
End Sub

Function fncWeekDay(dtDate As Date) As String

Dim ls_temp As String
On Error GoTo Err_WeekDay

fncWeekDay = Format(dtDate, "dddd")

Exit_WeekDay:
Exit Function

Err_WeekDay:
ls_temp = "fncWeekDay: " & Err.Description
MsgBox ls_temp
Resume Exit_WeekDay

End Function
 
R

RuralGuy

Did I miss where you described what the MsgBox was displaying for an
Err.Description? It and the Err.Number would have been useful
information. I'll take my best guess:

Change : [txtWeekDay] = fncWeekDay([txtScore_Date])

To : Me.txtWeekDay = fncWeekDay(Me.txtScore_Date)

I have an application which behaves differently on a machine with one
version of Access/VB than on another. We don't have the option of upgrading
Access because these are machines which have been given to my son for use in
his classroom in the Boston Public Schools (classroom for "behaviorally
challenged" 7th and 8th graders) - given to him, not the school system (he's
creative that way.) He doesn't have the software, he just has what's on the
machines. I'm hoping I can modify my code so it will work on the older
version. The code in question is below. The error occurs on
[txtWeekDay]=fncWeekDay([txtScore_Date]). Control is transferred to
"gs_temp = ...." as soon as we "step into" that line. We never enter
fncWeekDay(). The code for fncWeekDay() is at the bottom of this message.
[txtWeekDay] and [txtScore_Date] are unbound text boxes with nothing defined
for Control Source.
The databases are identical. We kept refreshing it to eliminate any
possibility of looking at the wrong copy, etc.

I've examined the references as they are identical in both environments.
Well... identical as to what you see checked in the references window -
dunno about the code the references are referring to.

I would really appreciate whatever creative thinking is out there with as
little of "did you try, etc" as possible, since I'm not able to debug this
on my own. I have to walk him through the debug process over the phone, and
he's the sort who has trouble sliding windows around to do stuff like
uncovering the Database window...

The versions that work: Access-9.0.6926 SP-3 VB-6.4.9969 Forms
3:2.01
The versions that don't: Access-9.0.3821 SR-4 VB-6.4.8714 Forms
3:2.01

Private Sub txtScore_Date_AfterUpdate()

On Error GoTo Err_txtScore_Date_AfterUpdate
Me.AllowAdditions = True
Dim li_debug As Integer
li_debug = 0
[txtWeekDay] = fncWeekDay([txtScore_Date])
Call SetButtonStates
Me.AllowAdditions = False
Exit_txtScore_Date_AfterUpdate:
Exit Sub

Err_txtScore_Date_AfterUpdate:
gs_temp = "txtScore_Date_AfterUpdate: " & Err.Description
MsgBox gs_temp

Resume Exit_txtScore_Date_AfterUpdate
End Sub

Function fncWeekDay(dtDate As Date) As String

Dim ls_temp As String
On Error GoTo Err_WeekDay

fncWeekDay = Format(dtDate, "dddd")

Exit_WeekDay:
Exit Function

Err_WeekDay:
ls_temp = "fncWeekDay: " & Err.Description
MsgBox ls_temp
Resume Exit_WeekDay

End Function

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
L

Laurel

That's in the subject of the posted message:

"There is an invalid use of the . or !"

Did I miss where you described what the MsgBox was displaying for an
Err.Description? It and the Err.Number would have been useful
information. I'll take my best guess:

Change : [txtWeekDay] = fncWeekDay([txtScore_Date])

To : Me.txtWeekDay = fncWeekDay(Me.txtScore_Date)

I have an application which behaves differently on a machine with one
version of Access/VB than on another. We don't have the option of
upgrading
Access because these are machines which have been given to my son for use
in
his classroom in the Boston Public Schools (classroom for "behaviorally
challenged" 7th and 8th graders) - given to him, not the school system
(he's
creative that way.) He doesn't have the software, he just has what's on
the
machines. I'm hoping I can modify my code so it will work on the older
version. The code in question is below. The error occurs on
[txtWeekDay]=fncWeekDay([txtScore_Date]). Control is transferred to
"gs_temp = ...." as soon as we "step into" that line. We never enter
fncWeekDay(). The code for fncWeekDay() is at the bottom of this message.
[txtWeekDay] and [txtScore_Date] are unbound text boxes with nothing
defined
for Control Source.
The databases are identical. We kept refreshing it to eliminate any
possibility of looking at the wrong copy, etc.

I've examined the references as they are identical in both environments.
Well... identical as to what you see checked in the references window -
dunno about the code the references are referring to.

I would really appreciate whatever creative thinking is out there with as
little of "did you try, etc" as possible, since I'm not able to debug this
on my own. I have to walk him through the debug process over the phone,
and
he's the sort who has trouble sliding windows around to do stuff like
uncovering the Database window...

The versions that work: Access-9.0.6926 SP-3 VB-6.4.9969 Forms
3:2.01
The versions that don't: Access-9.0.3821 SR-4 VB-6.4.8714 Forms
3:2.01

Private Sub txtScore_Date_AfterUpdate()

On Error GoTo Err_txtScore_Date_AfterUpdate
Me.AllowAdditions = True
Dim li_debug As Integer
li_debug = 0
[txtWeekDay] = fncWeekDay([txtScore_Date])
Call SetButtonStates
Me.AllowAdditions = False
Exit_txtScore_Date_AfterUpdate:
Exit Sub

Err_txtScore_Date_AfterUpdate:
gs_temp = "txtScore_Date_AfterUpdate: " & Err.Description
MsgBox gs_temp

Resume Exit_txtScore_Date_AfterUpdate
End Sub

Function fncWeekDay(dtDate As Date) As String

Dim ls_temp As String
On Error GoTo Err_WeekDay

fncWeekDay = Format(dtDate, "dddd")

Exit_WeekDay:
Exit Function

Err_WeekDay:
ls_temp = "fncWeekDay: " & Err.Description
MsgBox ls_temp
Resume Exit_WeekDay

End Function

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
R

RuralGuy

I guess my brain just didn't put it together, sorry. Does that mean
my best guess didn't work?


That's in the subject of the posted message:

"There is an invalid use of the . or !"

Did I miss where you described what the MsgBox was displaying for an
Err.Description? It and the Err.Number would have been useful
information. I'll take my best guess:

Change : [txtWeekDay] = fncWeekDay([txtScore_Date])

To : Me.txtWeekDay = fncWeekDay(Me.txtScore_Date)

I have an application which behaves differently on a machine with one
version of Access/VB than on another. We don't have the option of
upgrading
Access because these are machines which have been given to my son for use
in
his classroom in the Boston Public Schools (classroom for "behaviorally
challenged" 7th and 8th graders) - given to him, not the school system
(he's
creative that way.) He doesn't have the software, he just has what's on
the
machines. I'm hoping I can modify my code so it will work on the older
version. The code in question is below. The error occurs on
[txtWeekDay]=fncWeekDay([txtScore_Date]). Control is transferred to
"gs_temp = ...." as soon as we "step into" that line. We never enter
fncWeekDay(). The code for fncWeekDay() is at the bottom of this message.
[txtWeekDay] and [txtScore_Date] are unbound text boxes with nothing
defined
for Control Source.
The databases are identical. We kept refreshing it to eliminate any
possibility of looking at the wrong copy, etc.

I've examined the references as they are identical in both environments.
Well... identical as to what you see checked in the references window -
dunno about the code the references are referring to.

I would really appreciate whatever creative thinking is out there with as
little of "did you try, etc" as possible, since I'm not able to debug this
on my own. I have to walk him through the debug process over the phone,
and
he's the sort who has trouble sliding windows around to do stuff like
uncovering the Database window...

The versions that work: Access-9.0.6926 SP-3 VB-6.4.9969 Forms
3:2.01
The versions that don't: Access-9.0.3821 SR-4 VB-6.4.8714 Forms
3:2.01

Private Sub txtScore_Date_AfterUpdate()

On Error GoTo Err_txtScore_Date_AfterUpdate
Me.AllowAdditions = True
Dim li_debug As Integer
li_debug = 0
[txtWeekDay] = fncWeekDay([txtScore_Date])
Call SetButtonStates
Me.AllowAdditions = False
Exit_txtScore_Date_AfterUpdate:
Exit Sub

Err_txtScore_Date_AfterUpdate:
gs_temp = "txtScore_Date_AfterUpdate: " & Err.Description
MsgBox gs_temp

Resume Exit_txtScore_Date_AfterUpdate
End Sub

Function fncWeekDay(dtDate As Date) As String

Dim ls_temp As String
On Error GoTo Err_WeekDay

fncWeekDay = Format(dtDate, "dddd")

Exit_WeekDay:
Exit Function

Err_WeekDay:
ls_temp = "fncWeekDay: " & Err.Description
MsgBox ls_temp
Resume Exit_WeekDay

End Function

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
L

Laurel

I won't know until I get on the phone with my son again. It looks
promising. I have verified that it doesn't break the "good" versions of
Access and VB. I'll let you know.

But it's reassuring that you came up with the suggestion you did when you
*hadn't* seen the error message. May I ask what made you think of it?

I guess my brain just didn't put it together, sorry. Does that mean
my best guess didn't work?


That's in the subject of the posted message:

"There is an invalid use of the . or !"

Did I miss where you described what the MsgBox was displaying for an
Err.Description? It and the Err.Number would have been useful
information. I'll take my best guess:

Change : [txtWeekDay] = fncWeekDay([txtScore_Date])

To : Me.txtWeekDay = fncWeekDay(Me.txtScore_Date)

I have an application which behaves differently on a machine with one
version of Access/VB than on another. We don't have the option of
upgrading
Access because these are machines which have been given to my son for
use
in
his classroom in the Boston Public Schools (classroom for "behaviorally
challenged" 7th and 8th graders) - given to him, not the school system
(he's
creative that way.) He doesn't have the software, he just has what's on
the
machines. I'm hoping I can modify my code so it will work on the older
version. The code in question is below. The error occurs on
[txtWeekDay]=fncWeekDay([txtScore_Date]). Control is transferred to
"gs_temp = ...." as soon as we "step into" that line. We never enter
fncWeekDay(). The code for fncWeekDay() is at the bottom of this
message.
[txtWeekDay] and [txtScore_Date] are unbound text boxes with nothing
defined
for Control Source.
The databases are identical. We kept refreshing it to eliminate any
possibility of looking at the wrong copy, etc.

I've examined the references as they are identical in both environments.
Well... identical as to what you see checked in the references window -
dunno about the code the references are referring to.

I would really appreciate whatever creative thinking is out there with
as
little of "did you try, etc" as possible, since I'm not able to debug
this
on my own. I have to walk him through the debug process over the phone,
and
he's the sort who has trouble sliding windows around to do stuff like
uncovering the Database window...

The versions that work: Access-9.0.6926 SP-3 VB-6.4.9969 Forms
3:2.01
The versions that don't: Access-9.0.3821 SR-4 VB-6.4.8714 Forms
3:2.01

Private Sub txtScore_Date_AfterUpdate()

On Error GoTo Err_txtScore_Date_AfterUpdate
Me.AllowAdditions = True
Dim li_debug As Integer
li_debug = 0
[txtWeekDay] = fncWeekDay([txtScore_Date])
Call SetButtonStates
Me.AllowAdditions = False
Exit_txtScore_Date_AfterUpdate:
Exit Sub

Err_txtScore_Date_AfterUpdate:
gs_temp = "txtScore_Date_AfterUpdate: " & Err.Description
MsgBox gs_temp

Resume Exit_txtScore_Date_AfterUpdate
End Sub

Function fncWeekDay(dtDate As Date) As String

Dim ls_temp As String
On Error GoTo Err_WeekDay

fncWeekDay = Format(dtDate, "dddd")

Exit_WeekDay:
Exit Function

Err_WeekDay:
ls_temp = "fncWeekDay: " & Err.Description
MsgBox ls_temp
Resume Exit_WeekDay

End Function


_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
R

RuralGuy

Names like txtWeekDay and txtScore_Date are usually names given to
TextBox controls on a form but you referencing them as if they were
Fields in a RecordSet. I would not have responded at all if something
hadn't jumped out at me; or the response would have been a question
like "What error or what line?". I re-read your message several times
looking for the Err.Description or Err.Number but I didn't include the
Subject in the re-reading. Maybe something unconsious there. I'll
keep watching this thread to see if the problem is resolved.

I won't know until I get on the phone with my son again. It looks
promising. I have verified that it doesn't break the "good" versions of
Access and VB. I'll let you know.

But it's reassuring that you came up with the suggestion you did when you
*hadn't* seen the error message. May I ask what made you think of it?

I guess my brain just didn't put it together, sorry. Does that mean
my best guess didn't work?


That's in the subject of the posted message:

"There is an invalid use of the . or !"

<RuralGuy> wrote in message
Did I miss where you described what the MsgBox was displaying for an
Err.Description? It and the Err.Number would have been useful
information. I'll take my best guess:

Change : [txtWeekDay] = fncWeekDay([txtScore_Date])

To : Me.txtWeekDay = fncWeekDay(Me.txtScore_Date)

I have an application which behaves differently on a machine with one
version of Access/VB than on another. We don't have the option of
upgrading
Access because these are machines which have been given to my son for
use
in
his classroom in the Boston Public Schools (classroom for "behaviorally
challenged" 7th and 8th graders) - given to him, not the school system
(he's
creative that way.) He doesn't have the software, he just has what's on
the
machines. I'm hoping I can modify my code so it will work on the older
version. The code in question is below. The error occurs on
[txtWeekDay]=fncWeekDay([txtScore_Date]). Control is transferred to
"gs_temp = ...." as soon as we "step into" that line. We never enter
fncWeekDay(). The code for fncWeekDay() is at the bottom of this
message.
[txtWeekDay] and [txtScore_Date] are unbound text boxes with nothing
defined
for Control Source.
The databases are identical. We kept refreshing it to eliminate any
possibility of looking at the wrong copy, etc.

I've examined the references as they are identical in both environments.
Well... identical as to what you see checked in the references window -
dunno about the code the references are referring to.

I would really appreciate whatever creative thinking is out there with
as
little of "did you try, etc" as possible, since I'm not able to debug
this
on my own. I have to walk him through the debug process over the phone,
and
he's the sort who has trouble sliding windows around to do stuff like
uncovering the Database window...

The versions that work: Access-9.0.6926 SP-3 VB-6.4.9969 Forms
3:2.01
The versions that don't: Access-9.0.3821 SR-4 VB-6.4.8714 Forms
3:2.01

Private Sub txtScore_Date_AfterUpdate()

On Error GoTo Err_txtScore_Date_AfterUpdate
Me.AllowAdditions = True
Dim li_debug As Integer
li_debug = 0
[txtWeekDay] = fncWeekDay([txtScore_Date])
Call SetButtonStates
Me.AllowAdditions = False
Exit_txtScore_Date_AfterUpdate:
Exit Sub

Err_txtScore_Date_AfterUpdate:
gs_temp = "txtScore_Date_AfterUpdate: " & Err.Description
MsgBox gs_temp

Resume Exit_txtScore_Date_AfterUpdate
End Sub

Function fncWeekDay(dtDate As Date) As String

Dim ls_temp As String
On Error GoTo Err_WeekDay

fncWeekDay = Format(dtDate, "dddd")

Exit_WeekDay:
Exit Function

Err_WeekDay:
ls_temp = "fncWeekDay: " & Err.Description
MsgBox ls_temp
Resume Exit_WeekDay

End Function


_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
L

Laurel

Aha! Well, in the version I have, it works well, and I've gotten into the
habit of using that form all the time. I bet I'm going to have to revise a
lot of code if this fix gets us past that first error.

Names like txtWeekDay and txtScore_Date are usually names given to
TextBox controls on a form but you referencing them as if they were
Fields in a RecordSet. I would not have responded at all if something
hadn't jumped out at me; or the response would have been a question
like "What error or what line?". I re-read your message several times
looking for the Err.Description or Err.Number but I didn't include the
Subject in the re-reading. Maybe something unconsious there. I'll
keep watching this thread to see if the problem is resolved.

I won't know until I get on the phone with my son again. It looks
promising. I have verified that it doesn't break the "good" versions of
Access and VB. I'll let you know.

But it's reassuring that you came up with the suggestion you did when you
*hadn't* seen the error message. May I ask what made you think of it?

I guess my brain just didn't put it together, sorry. Does that mean
my best guess didn't work?


That's in the subject of the posted message:

"There is an invalid use of the . or !"

<RuralGuy> wrote in message
Did I miss where you described what the MsgBox was displaying for an
Err.Description? It and the Err.Number would have been useful
information. I'll take my best guess:

Change : [txtWeekDay] = fncWeekDay([txtScore_Date])

To : Me.txtWeekDay = fncWeekDay(Me.txtScore_Date)

I have an application which behaves differently on a machine with one
version of Access/VB than on another. We don't have the option of
upgrading
Access because these are machines which have been given to my son for
use
in
his classroom in the Boston Public Schools (classroom for
"behaviorally
challenged" 7th and 8th graders) - given to him, not the school system
(he's
creative that way.) He doesn't have the software, he just has what's
on
the
machines. I'm hoping I can modify my code so it will work on the
older
version. The code in question is below. The error occurs on
[txtWeekDay]=fncWeekDay([txtScore_Date]). Control is transferred to
"gs_temp = ...." as soon as we "step into" that line. We never enter
fncWeekDay(). The code for fncWeekDay() is at the bottom of this
message.
[txtWeekDay] and [txtScore_Date] are unbound text boxes with nothing
defined
for Control Source.
The databases are identical. We kept refreshing it to eliminate any
possibility of looking at the wrong copy, etc.

I've examined the references as they are identical in both
environments.
Well... identical as to what you see checked in the references
window -
dunno about the code the references are referring to.

I would really appreciate whatever creative thinking is out there with
as
little of "did you try, etc" as possible, since I'm not able to debug
this
on my own. I have to walk him through the debug process over the
phone,
and
he's the sort who has trouble sliding windows around to do stuff like
uncovering the Database window...

The versions that work: Access-9.0.6926 SP-3 VB-6.4.9969 Forms
3:2.01
The versions that don't: Access-9.0.3821 SR-4 VB-6.4.8714
Forms
3:2.01

Private Sub txtScore_Date_AfterUpdate()

On Error GoTo Err_txtScore_Date_AfterUpdate
Me.AllowAdditions = True
Dim li_debug As Integer
li_debug = 0
[txtWeekDay] = fncWeekDay([txtScore_Date])
Call SetButtonStates
Me.AllowAdditions = False
Exit_txtScore_Date_AfterUpdate:
Exit Sub

Err_txtScore_Date_AfterUpdate:
gs_temp = "txtScore_Date_AfterUpdate: " & Err.Description
MsgBox gs_temp

Resume Exit_txtScore_Date_AfterUpdate
End Sub

Function fncWeekDay(dtDate As Date) As String

Dim ls_temp As String
On Error GoTo Err_WeekDay

fncWeekDay = Format(dtDate, "dddd")

Exit_WeekDay:
Exit Function

Err_WeekDay:
ls_temp = "fncWeekDay: " & Err.Description
MsgBox ls_temp
Resume Exit_WeekDay

End Function


_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.


_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top