Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Insert statement
Hamish 
    
14 years ago
Hi Richard,

I get that, having to remove the asterisk and only inserting the fields that I want. But the problem is that, for example the records which is being copied from table 1 into table 2 will not display the ID's from table3. How does the apply in my case scenario.

An example done in the QBE is as follows, with SQL code:
INSERT INTO Table2 ( ID, VendorID, VendorName, Inventory, InventoryValue, DateAdded )
SELECT DLookUp("ID","Table3","VendorID=" & [VendorID]) AS ID, Table1.VendorID, Table1.VendorName, Table1.Inventory, Table1.InventoryValue, Table1.DateAdded
FROM Table1;

above SQL gives me the below result, which I have been tryig to do in VBA

TABLE 2 (what it should look like)...
ID VendorID VendorName Inventory InventoryValue DateAdded
1 1427036 Procter and Gamble 350 $400,000.00 7/08/2012
2 1428757 Reckitts
3 1429444 Natures Organics
4 1412269 Colgate Palmolive 400 $500,000.00 6/08/2011
---------------------------------------
Table 3 only holds the below:

ID VendorID VendorName
1 1427036 Procter and Gamble
2 1428757 Reckitt Benckiser
3 1429444 Nature Organics
4 1412269 Colgate Palmolive
---------------------------------------
Table 1 is the import table

VendorID VendorName Inventory InventoryValue DateAdded
1412269 Colgate Palmolive 400 $500,000.00 6/08/2011
1427036 Procter and Gamble 350 $400,000.00 7/08/2012
1428757 Reckitts
1429444 Natures Organics
Hope that this all make sense.


Reply from Richard Rost:

I'm lost. Tell me what you HAVE and what you're trying to GET and maybe I can help you better if I can approach the problem from the beginning instead of trying to fix what you've already done.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/17/2026 10:16:17 AM. PLT: 1s