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 Into
Masih Ostad Novin 
     
2 years ago
Hi. I have two forms. I want to insert data from form 1 to form 2. VBA on click buttons. And it is working nice but as you can see in the second form I don't want to have them on two different rows. I want it on the same row. I guess it has to do with WHERE condition. Do you have any idea? Thanks! See below for pics.
Masih Ostad Novin OP  @Reply  
     
2 years ago

Masih Ostad Novin OP  @Reply  
     
2 years ago

Masih Ostad Novin OP  @Reply  
     
2 years ago

Adam Schwanz  @Reply  
           
2 years ago
Get rid of the where criteria, dont need it when using insert. Then give it all 4 fields and their values instead of only two. On phone so cant type out an example but ill check back later if you dont get it
Masih Ostad Novin OP  @Reply  
     
2 years ago
What I want is that merge 2 IDs from left form to 1 ID in the right form. I changed the code but then it gave me error and I understand that because in the left I have only one field (Description) that goes to two fields in the right and the same with LotNr. Would you please correct me, thanks.
Masih Ostad Novin OP  @Reply  
     
2 years ago

Masih Ostad Novin OP  @Reply  
     
2 years ago

Adam Schwanz  @Reply  
           
2 years ago
Youre going to need to use a checkbox and a recordset and a more complicated setup if you want to pick them out of a continuous form. If you just made two combo boxes to pick them from it could be simpler. Say you made Lot1Combo and Lot2Combo and it had the ID (Column 0), the Lot (Column 1), and the description (Column 2) in it. Then you could do something like this (assuming you are storing the string value of the lot and not an ID)

Currentdb.execute "Insert Into CockTailLotT (Antibody1,Lot1,Antibody2,Lot2) VALUES (""" & Lot1Combo.Column(2) & """,""" & Lot1Combo.Column(1) & """,""" & Lot2Combo.Column(2) & """,""" & Lot2Combo.Column(1) & """)"
Masih Ostad Novin OP  @Reply  
     
2 years ago
Thanks a lot.

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/6/2026 12:37:27 PM. PLT: 1s