Ma*********@gmail.com wrote:
Yes I want to give it a try. Would like to see an example so I can see
it working.
OK, here's some air code. I'm assuming you have a form that is a single
form view with a recordsource that has one or more survey responses.
Thus the following code would need to be run in the on current event,
ie, whenever you chnage from one survey response to another.
I'll assume three text boxes, each with a label describing the question
and that the text box is the governing factor in vertical size.
'COde Starts
'Reset all text boxes such that they are in their
'"default position" and visible. To get their "default position",
'Record the .Top property of each text box when you have finished
'laying out the form. I'll assume an inch and a half per text box
'and that each text box is below the previous one,
'ie, 1, then, 2, then 3
dim lngChange as long
Me.txtQuestion1.Top = 1.5 * 1440 '1440 twips in an inch
Me.txtQuestion2.Top = Me.txtQuestion1.Top + 1.5 * 1440
Me.txtQuestion3.Top = Me.txtQuestion2.Top + 1.5 * 1440
Me.txtQuestion1.visible = true
Me.txtQuestion2.visible = true
Me.txtQuestion3.visible = true
'Now check the controlsource of each text box.
'If null, add the top property to lngChange.
lngChange = 0 'initialize
if isnull(me.txtQuestion1) then
me.txtQuestion1.visible = false
lngchange = lngchange + (1.5 * 1440)
end if
if isnull(me.txtQuestion2) then
me.txtQuestion2.visible = false
lngchange = lngchange + (1.5 * 1440)
else 'if visible, adjust it up the lngchange distance
me.txtQuestion2.top = me.txtquestion2.top - lngchange
end if
if isnull(me.txtQuestion3) then
me.txtQuestion3.visible = false
lngchange = lngchange + (1.5 * 1440)
else 'if visible, adjust it up the lngchange distance
me.txtQuestion3.top = me.txtquestion3.top - lngchange
end if
And so on....
--
Tim
http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me