Need a bit of help. I have a older rsview app running on Windows nt that runs fine. My clients wanted to update and now the same project will not run correctly. The display screen I am having an issue with is a simple recipe screen. They are loading recipes that are based in access into a text box. I tried to step through the VBA code and it appears it is erroring out on the first line "Set RecipeDb = OpenDatabase(DatabasePath & "CookOnStove.mdb", False, False)
"
They must have changed something between revisions but I am unsure. Here is a copy of the code. Do any of you see why this no longer works when it worked fine?
RecipeDB is defined as Database
RecipeRs is defined as Recordset
On Error GoTo ErrHandler
Set RecipeDb = OpenDatabase(DatabasePath & "CookOnStove.mdb", False, False)
' Select Name of Recipe
SQLStmt = "Select * from Recipes Order By RecipeName"
Set RecipeRs = RecipeDb.OpenRecordset(SQLStmt)
If Screen = "RecipeSel" Then
gCommand.Execute "Invoke Recipe.ListBox1.Clear"
LBox = "Invoke Recipe.ListBox1.AddItem("
ElseIf Screen = "RecipeEdit" Then
gCommand.Execute "Invoke RecEdit.RecipeList.Clear"
LBox = "Invoke RecEdit.RecipeList.AddItem("
End If
Do While Not RecipeRs.EOF
test1 = RecipeRs!RecipeName
gCommand.Execute LBox & Chr$(34) & test1 & Chr$(34) & ", -1)"
RecipeRs.MoveNext
Loop
ErrHandler:
'Build a log message
sMsg = "RSView32 VBA Error; Sub: GetRecipes, " & Err.Number & ":" & Err.Description
'Log the error to the Activity Log
gActivity.Log sMsg, roActivityError, , , "Confirm()"
'Print error message to Immediate window in VBA editer
Debug.Print "RSView32 VBA Error " & Err.Number & ":" & Err.Description
MsgBox sMsg
Exit Sub
End Sub
"
They must have changed something between revisions but I am unsure. Here is a copy of the code. Do any of you see why this no longer works when it worked fine?
RecipeDB is defined as Database
RecipeRs is defined as Recordset
On Error GoTo ErrHandler
Set RecipeDb = OpenDatabase(DatabasePath & "CookOnStove.mdb", False, False)
' Select Name of Recipe
SQLStmt = "Select * from Recipes Order By RecipeName"
Set RecipeRs = RecipeDb.OpenRecordset(SQLStmt)
If Screen = "RecipeSel" Then
gCommand.Execute "Invoke Recipe.ListBox1.Clear"
LBox = "Invoke Recipe.ListBox1.AddItem("
ElseIf Screen = "RecipeEdit" Then
gCommand.Execute "Invoke RecEdit.RecipeList.Clear"
LBox = "Invoke RecEdit.RecipeList.AddItem("
End If
Do While Not RecipeRs.EOF
test1 = RecipeRs!RecipeName
gCommand.Execute LBox & Chr$(34) & test1 & Chr$(34) & ", -1)"
RecipeRs.MoveNext
Loop
ErrHandler:
'Build a log message
sMsg = "RSView32 VBA Error; Sub: GetRecipes, " & Err.Number & ":" & Err.Description
'Log the error to the Activity Log
gActivity.Log sMsg, roActivityError, , , "Confirm()"
'Print error message to Immediate window in VBA editer
Debug.Print "RSView32 VBA Error " & Err.Number & ":" & Err.Description
MsgBox sMsg
Exit Sub
End Sub