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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recordset error after converting to Access 2003

Status
Not open for further replies.

doberfan

Technical User
Jul 23, 2002
5
0
0
US
Hi,
I had a problem since converting from Access 97 to Access 2003. What I am trying to do is print the same basic report but with different values that come from a query. Pasted below is the code it breaks at "rst.[CoatingNumber]" and gives an error message of "Method or data member not found". It work fine in Access 97. I have searched for help and checked a few things. In the References, the dao3.6 object library is select but lower on the priority than the 11.0 object library. I could not move the dao 3.6 to higher priority. Please take a offer any advice as our manufacturing facility uses this daily.

Thanks,
DF

Private Sub PrintAllBatchReports_Click()
On Error GoTo Err_PrintAllBatchReports_Click

Dim stDocName As String
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim strCriteria As String
Dim strFCriteria As String

Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("PaintMixOrderPrintOut")

While Not rst.EOF
strFCriteria = "[Coating Number]=" & rst.[CoatingNumber] & " and [ProdLine]=" & rst.[ProdLine] & " and [Tank]='" & rst.[Tank] & "'" & " and [AutoNumber]=" & rst.[AutoNumber]
strCriteria = "[Amount]=" & rst.[Amount] & " and [Coating Number]=" & rst.[CoatingNumber] & " and [AutoNumber]=" & rst.[AutoNumber]

If rst.Amount = 0 And rst.AmountBatch = "b" Then
DoCmd.OpenReport "FullBatchFormula", acNormal, , strFCriteria
End If

If rst.Amount > 0 Then
DoCmd.OpenReport "PartialBatchFormula", acNormal, , strCriteria
End If
rst.MoveNext
Wend
DoCmd.OpenReport "PaintMixOrderReport", acNormal


rst.Close
dbs.Close
Set rst = Nothing

Exit_PrintAllBatchReports_Click:
Exit Sub

Err_PrintAllBatchReports_Click:

MsgBox Err.Description
Resume Exit_PrintAllBatchReports_Click

End Sub
 
What about this ?
rst!CoatingNumber

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hey PHV,
Tried it but same error message.

df
 
Anybody have any further suggestions?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top