Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot debug Form code in any version of Access newer than 2000

Status
Not open for further replies.

MkIIISupra

Programmer
Apr 17, 2002
108
US
I try to run the debugger so I can step through the code and see where something is bombing out. And I get this error message when it tries to move to a new record:

"Microsoft Office Access"
"You can't use the GoToRecord action or method on an object in design view."

How the heck am I supposed to step through my code if I get this error and kicked out of debug mode? I could do it in 97 and 2000 but not in 2002 or now 2003. And it's driving me nutz! I have to find a Win2K machine in my office that still has O2K on it just to debug an stupid app that is written on an XP Pro box with Office 2003!!!

System Specs:
Dell Optiplex GX260
Windows XP Professional Ver 2002 Service Pack 1
Office 2003 SP2

So how can I get back that which I had in earlier versions so I can continue to be productive instead of having to waste time moving from one system to another?

PS: corporate standard is now WinXP-Pro with Office 2003, so my ability to access Win2K O2K is getting limited as the systems are changed.

One by one the penguins steal my sanity!
 
Don't debug while in design view ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I am not in design view. The form is in active mode, I enter data then press the button or perform the action required to initiate code execution and the form is still running but the code window pops up like it's supposed to. This is the problem, there are some steps that I loop through and I can't because of this issue.

One by one the penguins steal my sanity!
 
Bump to top of list... any ideas? I haven't been able to find anything on the Microsoft web site yet. All I know is this is really annoying and counter productive.

One by one the penguins steal my sanity!
 
Most of the DoCmd thingies won't work when debugging, and gives similar errormessages.

You might experience a bit more answers if you give us a bit more to chew on (since this is a coding forum, perchance some code?)

Roy-Vidar
 
Option Compare Database
Option Explicit

Dim
stOrgTp, stStructElem, stStuName, stDistNum, stDistName, stSchNum _
, stSchName, stGrade, stReqByName, stPhNum, stEmail, stReason _
, stLeft, stMidl, stRight, stHold, stRecHold As String
Dim intLen, intLenTwo, intCnt As Integer
Dim lngCnt As Long
Dim blWrite As Boolean


Private Sub btnCleanFile_Click()
On Error GoTo Err_btnCleanFile_Click

lngCnt = 0
intLen = 0
intLenTwo = 0
stLeft = ""
stMidl = ""
stRight = ""
stHold = ""
stRecHold = ""
blWrite = False

Do

If
IsNull(Me.dataField) Then

DoCmd.GoToRecord , , acNext This is where the debug errors out, so I have to load the application on a Win2K machine (last one leaves soon!) to get past this point during the debug phase, while the form is running!!

End If


' Load first 10 chars for testing purposes
stHold = Left$(Me.dataField, 6)

' Test the first 10 chars, if they equal the value listed then reload the container _
with a longer version of the string for manipulation.

If (stHold) = "ELM ID" Then

If (blWrite) = True Then

Me.orgTp.Value = stOrgTp
Me.structElemNum.Value = stStructElem
Me.stuName.Value = stStuName
Me.distNum.Value = stDistNum
Me.distName.Value = stDistName
Me.schNum.Value = stSchNum
Me.schName.Value = stSchName
Me.grade.Value = stGrade
Me.reqByName.Value = stReqByName
Me.phNum.Value = stPhNum
Me.eMail.Value = stEmail
Me.reason.Value = stReason

stOrgTp = ""
stStructElem = ""
stStuName = ""
stDistNum = ""
stDistName = ""
stSchNum = ""
stSchName = ""
stGrade = ""
stReqByName = ""
stPhNum = ""
stEmail = ""
stReason = ""
stLeft = ""
stMidl = ""
stRight = ""
stHold = ""
stRecHold = ""

blWrite = False

End If


stLeft = Left$(Me.dataField, 29)
stLeft = Right$(stLeft, 21)
stOrgTp = Left$(stLeft, 10)
stStructElem = Right$(stLeft, 11)

intLen = Len(Me.dataField)
intLen = intLen - 39
stRight = Right$(Me.dataField, intLen)
stStuName = stRight

ElseIf (stHold) = "Distri" Then

stDistNum = Mid$(Me.dataField, 11, 5)
stDistName = Mid$(Me.dataField, 16, 16)
stSchNum = Mid$(Me.dataField, 40, 5)
stSchName = Mid$(Me.dataField, 45, 16)
stGrade = Right$(Me.dataField, 2)

ElseIf (stHold) = "Reques" Then

DoCmd.GoToRecord , , acNext
intCnt = intCnt + 1
stReqByName = Left$(Me.dataField, 24)
stPhNum = Mid$(Me.dataField, 25, 15)
stEmail = Right$(Me.dataField, 26)

ElseIf (stHold) = "Reason" Then

stReason = Mid$(Me.dataField, 8, 35)

End If

blWrite = True
intCnt = intCnt + 1
DoCmd.GoToRecord , , acNext

Loop Until intCnt = 2029

Exit_btnCleanFile_Click:
Exit Sub

Err_btnCleanFile_Click:
MsgBox Err.Description
Resume Exit_btnCleanFile_Click

End Sub

One by one the penguins return my sanity, as day by day Microsoft steals my sanity!

OpenSuSE 10.0 kicks fanny!
 
BUMP... let's do the BUMP!!! :)

One by one the penguins return my sanity, as day by day Microsoft steals my sanity!

OpenSuSE 10.0 kicks fanny!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top