5 hours ago: Our file storage provider is running maintenance today. If any videos don't load, wait a minute, refresh the page, and try again. Sorry for any inconvenience.  Dismiss
 
Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > TechHelp > Directory > Access > Relational Combo < Vehicle Maintenance | Intro to VBA >
Back to Relational Combo    Comments List
NotInList Event Upload Images   Link   Email  
Jay Clifford       
2 years ago
I am creating a personal database for tracking all purchases.
it's a continuous form where I have several Combo Boxes to select such things as Store_ID, Brand_ID, general category and a sub category.
In the sub category I have a SubCatID auto field, SubCatName, and a GeneralCatId feild.
I really like the VBA code
Private Sub Gen_Cat_Combo_NotInList(NewData As String, Response As Integer)
If MsgBox(NewData & " is not in the list. Add itC?", vbYesNoCancel) <> vbYes Then
        ' don't add it
        Response = acDataErrContinue
    Else
        ' add it
        CurrentDb.Execute "INSERT INTO GenCatT1 (Gen_Cat_Name) VALUES (""" & NewData & """)"
        Response = acDataErrAdded
    End If
End Sub


Found in the Tech Extended Video "Combo Box that Gets Values from Another Table"

Question: how do I add the GenCatID to the SubCat Table?
I assume that it goes into the Current Execute line, but I don't know the correct syntax.
In other words I want to add 2 values to the Combo Box list.

Jay Clifford a Silver member
Adam Schwanz             
2 years ago
Yes if you want to add more fields you just need to enter more, I would strongly suggest you look into the SQL seminar part 1 and 2 at the least for help learning how these SQL statements function.

INSERT INTO table_name (column1, column2, column3, ...) VALUES (value1, value2, value3, ...);

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

 
 
 

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 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 7/14/2024 11:08:29 AM. PLT: 1s