Solved

Visual Basic Append table from Subform

Posted on 2009-06-28
1
412 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Familiarize people with the process of utilizing SQL Server stored procedures 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 Micr…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

733 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