S
S Jackson
I don't have any excuses other than sheer ignorance but when I began
designing my application I used Access 2000. Now, of course, I am having
problems with converting the db to Access 97. I have converted it and then
gone to another user's machine with Office 97 installed to test it out and
so far, here are the errors I have encountered when trying to Compile and
Save all Modules:
1. Missing DAO Library references - this was easy to fix: unchecked the
missing library and checked the DAO version available
2. The following code on this form gives me this error: Expected Function
or Variable. The code stops at & .MoveLast. Can anyone help?
'Set variables
Dim stDocName As String
Dim stLinkCriteria As String
'Set which form to open
stDocName = "frmSurveyors"
'Set search criteria, "Jane" opens up all Surveyors with the name "Jane"
stLinkCriteria = "[SvyName] Like " & "'" & Me![txtSearch] & "*" & "'"
'Open the form in hidden view until record count complete
DoCmd.OpenForm stDocName, , , stLinkCriteria, , acHidden
'Count the number of records found and return number to user (if none
found-msgbox displayed)
With Forms(stDocName).RecordsetClone
If .RecordCount = 0 Then
MsgBox "The database did not find any records, please try again", ,
"Surveyor Search Results"
DoCmd.Close acForm, stDocName
Else
MsgBox "The database found " _
& .MoveLast _
& .RecordCount _
& " case(s).", vbOKOnly + vbInformation, "Surveyor Search Results"
Forms(stDocName).Visible = True
End If
End With
3. Switchboard problem: Compile Error: Method or data member not found.
Error occurs at Set con=Application.CurrentProgect.Connection in Private Sub
FillOptions:
' Open the table of Switchboard Items, and find
' the first item for this Switchboard Page.
Set con = Application.CurrentProject.Connection
stSql = "SELECT * FROM [Switchboard Items]"
stSql = stSql & " WHERE [ItemNumber] > 0 AND [SwitchboardID]=" &
Me![SwitchboardID]
stSql = stSql & " ORDER BY [ItemNumber];"
Set rs = CreateObject("ADODB.Recordset")
rs.Open stSql, con, 1 ' 1 = adOpenKeyset
Any help is GREATLY appreciated. Thank you in advance.
S. Jackson
designing my application I used Access 2000. Now, of course, I am having
problems with converting the db to Access 97. I have converted it and then
gone to another user's machine with Office 97 installed to test it out and
so far, here are the errors I have encountered when trying to Compile and
Save all Modules:
1. Missing DAO Library references - this was easy to fix: unchecked the
missing library and checked the DAO version available
2. The following code on this form gives me this error: Expected Function
or Variable. The code stops at & .MoveLast. Can anyone help?
'Set variables
Dim stDocName As String
Dim stLinkCriteria As String
'Set which form to open
stDocName = "frmSurveyors"
'Set search criteria, "Jane" opens up all Surveyors with the name "Jane"
stLinkCriteria = "[SvyName] Like " & "'" & Me![txtSearch] & "*" & "'"
'Open the form in hidden view until record count complete
DoCmd.OpenForm stDocName, , , stLinkCriteria, , acHidden
'Count the number of records found and return number to user (if none
found-msgbox displayed)
With Forms(stDocName).RecordsetClone
If .RecordCount = 0 Then
MsgBox "The database did not find any records, please try again", ,
"Surveyor Search Results"
DoCmd.Close acForm, stDocName
Else
MsgBox "The database found " _
& .MoveLast _
& .RecordCount _
& " case(s).", vbOKOnly + vbInformation, "Surveyor Search Results"
Forms(stDocName).Visible = True
End If
End With
3. Switchboard problem: Compile Error: Method or data member not found.
Error occurs at Set con=Application.CurrentProgect.Connection in Private Sub
FillOptions:
' Open the table of Switchboard Items, and find
' the first item for this Switchboard Page.
Set con = Application.CurrentProject.Connection
stSql = "SELECT * FROM [Switchboard Items]"
stSql = stSql & " WHERE [ItemNumber] > 0 AND [SwitchboardID]=" &
Me![SwitchboardID]
stSql = stSql & " ORDER BY [ItemNumber];"
Set rs = CreateObject("ADODB.Recordset")
rs.Open stSql, con, 1 ' 1 = adOpenKeyset
Any help is GREATLY appreciated. Thank you in advance.
S. Jackson