Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
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 February 22nd, 2006, 05:21 AM
Authorized User
Join Date: Feb 2006
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default Adding text/controls from one form to another

Hi ,
I have 2 forms :
in one i hav 10 textboxes . Now i need that when i put a text in specific textbox then the text will appear in [u]right place second form</u> as text or textbox control , and when i delete from textbox in first form - this will delete text from the srcond form and other texts below will come up that no white-spaces will be in second form .
How can i implement this ?


Old February 24th, 2006, 10:10 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG

If you have Form1 and Form2 with TextBox1, Textbox2, etc. then if you type in TextBox1 in Form1, you assign it to TextBox1 if Form2 like this in the textbox's After Update event:

Forms.Form2.Form.TextBox1 = Me.TextBox1

If you want textboxes in Form2 to disappear when empty, you'd put this instead of the above statement

If IsNull(Me.TextBox1) Then
    Forms.Form2.Form.TextBox1.Visible = False
    Forms.Form2.Form.TextBox1.Visible = True
    Forms.Form2.Form.TextBox1 = Me.TextBox1
End If

But you also want to move up the other textboxes in Form2 if ones above them are empty. That is strange for a form. That's more something you do with reports, not forms.

The only way I can think of doing that is spacing each textbox a known and equal distance from the top. Then in a loop, you see how many textboxes are visible. Then set each visible textboxes position on the form using the .Height property.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division

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 Scootterp Access VBA 2 August 4th, 2009 02:32 PM
Adding controls to a form based on data received jontheniceguy Visual Basic 2005 Basics 0 April 7th, 2006 10:07 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.