Wrox Programmer Forums
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 20th, 2006, 05:39 PM
Authorized User
Join Date: Feb 2006
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default Adding controls to a form

I have looked on the net and in my Access books and I can't find the code to dynamically add controls, such as combo boxes, labels, etc. to a form. I would like to have a drop down box so the user can pick a number and that many combo boxes and labels would be created. And once that is done can the source for the combo box be then set?

Old April 21st, 2006, 06:35 AM
Friend of Wrox
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts

That's one option. I usually just create the combo boxes and labels and make them invisible. Then on the combo box after update event, set the combo boxes visible. I think you can either set the recordsource beforehand, or on the fly, but I don't have experience with that.

Also, make sure you use whatever code you use on the combo box after update event on the form's on current event.


Old August 4th, 2009, 02:32 PM
Registered User
Join Date: Aug 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default A better way for txtBSCPIN1 to txtBSCPIN16 testing

I read your Q about testing txtBSCPIN1 to txtBSCPIN16 at EE and commented at:
Issue 16 is showing how to solve this using no-code.



Similar Threads
Thread Thread Starter Forum Replies Last Post
adding controls on vba form from an addin narendrapawar Pro VB 6 1 April 25th, 2010 04:59 PM
Adding controls to a form based on data received jontheniceguy Visual Basic 2005 Basics 0 April 7th, 2006 10:07 AM
Adding text/controls from one form to another Paula222 Access VBA 1 February 24th, 2006 10:10 AM
Adding Form controls in Datagrid (How to) chiefouko VS.NET 2002/2003 5 July 13th, 2004 12:24 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.