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
Else
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
|