Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Should I see you should I not (feilds on Forms)

Status
Not open for further replies.

ninash

Technical User
Jul 6, 2001
163
GB
Hi Guys,

I have what is probably a very easy problem to solve but in my brain fried state I can't work it out.... I hope you can help.

I have a form that when it opens displays questions...
some of the questions need a date reply others a yes/no and lastly a selection from a combobox.

My problem is I want to tidy up the form by hiding the reply boxes I don't need for that question.

I have tried a straight visible false/true property on form open based on the question ID, however this didn't work.

This is really urgent now so any help anyone can give me would be very welcome
 
Is the question ID on the same form that you are opening or on a separate form? If on the same form, does the user select a question from a combobox? Need more info.

PaulBasel
 
Hi there,

Assuming you have a prime question that if answered yes no for example, then means other questions are relevant. If you set the visible property of the dependant questions labels and contols to false in the design view, when the form loads it will only show the prime question.

Click on event "after update" for YourPrimeQuestionCheckbox

add vb code:
'(note -1 = checked, 0 = unchecked)
if YourPrimeQuestionCheckbox = -1 then
'Shows the questions you want to apear when box is ticked yes"
Otherquestion.visible = true
OtherquestionLabel.visible = true
else
' leaves the questions hidden.

end if


The gist of it is to use the after update event to set things to be visible or not

hope it helps

Simon.
 
No the questions are selected via a query and the question ID is transfered into the form by that query. The user has no interaction as to how many questions arrive and are displayed on the continuous forms (1 percopy of the form).
They only need to answer the questions hence the problem of the questions requiring different Types of answers....
I just don't want to confuse them by having all the boxes for replys displayed on every form
 
OK, so hows about adding fields to the question table that defines the answer style box required, integer, use 1 for required, 0 for not
style1 style2 style3
q1 1 0 0

in the form footer add un unbound text box (for each style) txtStyle1 make the data source for the it =sum([style1]}

Now if style1 is required then txtStyle1 will be greater than 0, so you can use VB on form load to set the replybox. visible = true

?

Without seeing the form it's my best Guess,

Good luck

Simon
 
All I want it to make the form hide or unhide the reply boxes that the user don't need....

By using something like

If questID.value = 2 or questID.value = 3 then
textbox1.visible = False
textbox2.visible = true
else
textbox1.visible = true
textbox2.visible = false
Endif
 
does anyone have any ideas on how to help me with this problem
 
If you are only displaying a single record in the window then you could place the example you wrote in the ONCURRENT Event. It should work. If you are displaying all of the questions at once, then you need to tell it to build the form instances based on your query results.
IF value 1 then ...
Forms!YourFormName!txtYourControlName1.visible = False
Forms!YourFormName!lblYourControlName1.visible = False
and so on...

Hard to tell what is your answer without seeing the way your form builds. Sounds like the other answers are also on the right track, hope something clicks.
JerseyBoy

Remember: self-praise is no recommendation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top