?
Solved

Visual Basic Append table from Subform

Posted on 2009-06-28
1
Medium Priority
?
426 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 2000 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

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
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Suggested Courses

770 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