Solved

Visual Basic Append table from Subform

Posted on 2009-06-28
1
397 Views
Last Modified: 2013-11-27
Hello everyone, I am trying to copy and append 3 fields as a new record in the same table from a subform of a subform based on the record the user is on.  

Private Sub plow_Click()
    Dim SQL As String
    SQL = "INSERT INTO [c resources] ( taskid, resacc, resunit )"
    SQL = SQL & "SELECT [c resources].taskid, [c resources].resacc, [c resources].resunit FROM [c resources]"
    SQL = SQL & "WHERE [c resources].resourceid = [forms]![a schedule Query Form Resources and Measures]![sfTasks]![sfResources]![resourceid];"
   
End Sub

Any ideas?
0
Comment
Question by:wellesleydpw
1 Comment
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 24731476
SQL = SQL & "WHERE [c resources].resourceid =" &  [forms]![a schedule Query Form Resources and Measures]![sfTasks].Form![sfResources].Form![resourceid]

Assumes that all your names are correct and that recourceid is a number.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

813 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now