If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
"There is an invalid use of the . or !" -version problem
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 |
#2
|
|||
|
|||
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) On Wed, 31 Aug 2005 13:19:59 -0400, "Laurel" wrote: 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. |
#3
|
|||
|
|||
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) On Wed, 31 Aug 2005 13:19:59 -0400, "Laurel" wrote: 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. |
#4
|
|||
|
|||
I guess my brain just didn't put it together, sorry. Does that mean
my best guess didn't work? On Thu, 1 Sep 2005 07:36:38 -0400, "Laurel" wrote: 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) On Wed, 31 Aug 2005 13:19:59 -0400, "Laurel" wrote: 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. |
#5
|
|||
|
|||
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? RuralGuy wrote in message ... I guess my brain just didn't put it together, sorry. Does that mean my best guess didn't work? On Thu, 1 Sep 2005 07:36:38 -0400, "Laurel" wrote: 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) On Wed, 31 Aug 2005 13:19:59 -0400, "Laurel" wrote: 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. |
#6
|
|||
|
|||
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. On Thu, 1 Sep 2005 08:33:49 -0400, "Laurel" wrote: 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? RuralGuy wrote in message .. . I guess my brain just didn't put it together, sorry. Does that mean my best guess didn't work? On Thu, 1 Sep 2005 07:36:38 -0400, "Laurel" wrote: 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) On Wed, 31 Aug 2005 13:19:59 -0400, "Laurel" wrote: 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. |
#7
|
|||
|
|||
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. RuralGuy wrote in message ... 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. On Thu, 1 Sep 2005 08:33:49 -0400, "Laurel" wrote: 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? RuralGuy wrote in message . .. I guess my brain just didn't put it together, sorry. Does that mean my best guess didn't work? On Thu, 1 Sep 2005 07:36:38 -0400, "Laurel" wrote: That's in the subject of the posted message: "There is an invalid use of the . or !" RuralGuy wrote in message m... 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) On Wed, 31 Aug 2005 13:19:59 -0400, "Laurel" wrote: 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. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Upgraded PPT cannot access files modified under earlier version | pursang | Powerpoint | 3 | April 28th, 2005 10:16 PM |
Suggested featu File version launcher | tygrus | General Discussions | 1 | April 26th, 2005 05:26 PM |
Office 2003 Trial Version | OldTimer | General Discussions | 1 | March 23rd, 2005 04:55 PM |
Will I lose Access 2002 if I install Office 2003 | Mark | Setup, Installing & Configuration | 5 | September 1st, 2004 05:51 PM |
Upgrade 03 Trial to Full | Tom | Publisher | 2 | June 4th, 2004 12:18 AM |