473,503 Members | 13,028 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dynamic forms

Hi,

I wonder if anyone can help with this problem. I have a form with
about 20 different fields which contains info imported from access
(basicly its the results of a questionnaire) some of the fields might
be blank. I want the null fields to be not visable and field below it
to fill the space of the one above it so it doesnt leave any unsightly
gaps.
Also I would like some fields to be the same size as the text in them.
So the size would change dynamicly.

What I need to know is:

Is what I'm asking possible?
How is it done?
Are there any examples on the net?
Thanks for any help

Mar 12 '07 #1
5 2203
Ma*********@gmail.com wrote:
be blank. I want the null fields to be not visable and field below it
to fill the space of the one above it so it doesnt leave any unsightly
gaps.
It can be done, but you have to be prepared to write a fair bit of code
that manipulates the .top property of all controls below a question that
is made invisible. This can be a PITA, so the question you have to ask
yourself is "what do I hope to gain doing it this complicated way versus
just displaying null values as 'Not answered'". For example, say a
question is "Do you collect toenail clippings?" and the field name is
[Toenails], you can write, as the controlsource for the corresponding
text box control on your form:

=nz([Toenails],"Not answered by respondant")

Or something similar.

It's simpler and *will* save you a lot of grief and frustration.
Also I would like some fields to be the same size as the text in them.
So the size would change dynamicly.
Easy enough in a report, difficult in a form. Use vertical scroll bars
in your text box.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
Mar 12 '07 #2
On Mar 12, 5:51 pm, Tim Marshall
<TIM...@PurplePandaChasers.Moertheriumwrote:
Marshall...@gmail.com wrote:
be blank. I want the null fields to be not visable and field below it
to fill the space of the one above it so it doesnt leave any unsightly
gaps.

It can be done, but you have to be prepared to write a fair bit of code
that manipulates the .top property of all controls below a question that
is made invisible. This can be a PITA, so the question you have to ask
yourself is "what do I hope to gain doing it this complicated way versus
just displaying null values as 'Not answered'". For example, say a
question is "Do you collect toenail clippings?" and the field name is
[Toenails], you can write, as the controlsource for the corresponding
text box control on your form:
Yes I want to give it a try. Would like to see an example so I can see
it working.

I think it would make things simpler for my users to not see the
answers than a default message.


=nz([Toenails],"Not answered by respondant")

Or something similar.

It's simpler and *will* save you a lot of grief and frustration.
Also I would like some fields to be the same size as the text in them.
So the size would change dynamicly.

Easy enough in a report, difficult in a form. Use vertical scroll bars
in your text box.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me

Mar 12 '07 #3
On Mar 12, 2:21 pm, Marshall...@gmail.com wrote:
>
Yes I want to give it a try. Would like to see an example so I can see
it working.

I think it would make things simpler for my users to not see the
answers than a default message.
Try writing every field that's not null to a multi-dimensional array.
Once you hit the end you'll know how many fields you have. Do a For/
Next loop and write the values to your generic text boxes (i.e.
Array(X,Y) = txtAnswer1, txtAnswer2, txtAnswer3, etc...)

It's cludgey at best, and a headache at worst. Enjoy.

Mar 12 '07 #4
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
Mar 12 '07 #5
On Mar 12, 2:21 pm, Marshall...@gmail.com wrote:
>
Yes I want to give it a try. Would like to see an example so I can see
it working.

I think it would make things simpler for my users to not see the
answers than a default message.
Try writing every field that's not null to a multi-dimensional array.
Once you hit the end you'll know how many fields you have. Do a For/
Next loop and write the values to your generic text boxes (i.e.
Array(X,Y) = txtAnswer1, txtAnswer2, txtAnswer3, etc...)

It's cludgey at best, and a headache at worst. Enjoy.

Mar 12 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
3492
by: Bil Muh | last post by:
Esteemede Developers, I would like to Thank All of You in advance for your sincere guidances. I am developing a software using Visual C++ .NET Standard Edition with Windows Form (.NET)...
1
17629
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
1
4078
by: mtech1 | last post by:
Access 2002 I am trying to create a dynamic crosstab report that parameters come from 3 different forms. I get runtime error 3070 - The Microsoft Jet database engine does not recognize...
3
6797
by: MikeY | last post by:
Hi Everyone, I am working in C#, windows forms.My question is this. All my button dynamic controls properties are present and accounted for except for the"FlatStyle" properties. I can't seem to...
7
2004
by: AdeelAlvi | last post by:
iam working on a project called service desk that automates the departmental services online .one major component i have to create is that to convert paper based forms into dynamic webforms . i...
2
2923
by: deejayquai | last post by:
Hi I'm trying to produce a report based on a dynamic crosstab. Ultimately i'd like the report to actually become a sub report within a student end of year record of achievement. The dynamic...
3
4765
by: RahimAsif | last post by:
I am writing an application that requires the a portion of the main menu to be dynamic. The menu has file, panels, view files and help across the top. The view files sub menu needs to be...
5
2535
by: matt | last post by:
hello, i am on an interesting project. in this project, i have to create dynamic data-entry forms for offline-users to fill out, save locally, and eventually postback to our app (when back...
0
2707
by: JamesOo | last post by:
I have the code below, but I need to make it searchable in query table, below code only allowed seach the table which in show mdb only. (i.e. have 3 table, but only can search either one only,...
2
3317
by: yomadhu | last post by:
I created a dynamic form in javascript. Am unable to get those values in to php to display. I need all details. If i add 10 rows the i need to display those all values. Can any one help me for that...
0
7212
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7296
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7364
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7470
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5604
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3186
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1524
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
751
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
405
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.