[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

recorset nesting issue

Posted on 2011-04-27
3
Medium Priority
?
297 Views
Last Modified: 2012-05-11
I need to open a recordset in a query to copy a couple fields then insert them into another table. Not sure if I am going about this right. At the moment I am getting this error in the last line of the code below. "Compole error. Method or data member found".

Any ideas?
Dim db As DAO.Database
Set db = CurrentDb
Dim rst As DAO.Recordset
Dim sSql
sSql = "select * from qryCashFlowCreditToAttribute WHERE SelectTemp= " & "True"

Set rst = db.OpenRecordset(sSql)

    Dim rstCode As DAO.Recordset
    Dim sqlCode As String
    sqlCode = "Select * From tblSupplierInvoices_1"
    Set rstCode = db.OpenRecordset(sqlCode, dbOpenDynaset)
    rstCode.AddNew
    rstCode![SupplierID] = Me!SupplierID
    rstCode![SupplierName] = Me!SupplierName
    rstCode![VATCategory] = Me!VATCategory
    rstCode![VAT] = Me!VAT
    rstCode![InvoiceAddressCountry] = Me!Country
    rstCode![date] = rst.CashFlowDate

Open in new window

0
Comment
Question by:Shawn
3 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 2000 total points
ID: 35480132
I suspect:

rstCode![date] = rst![CashFlowDate]
0
 
LVL 1

Expert Comment

by:bradburke
ID: 35480136
Try:

rstCode![date] = rst!CashFlowDate
 
I replaced rst.CashFlowDate with rst!CashFlowDate
0
 
LVL 1

Author Closing Comment

by:Shawn
ID: 35480166
thanks again!
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question