tolga Posted December 18, 2009 Posted December 18, 2009 Hi everyone, I'm trying to develop a medical database. My problem is: I' m trying to make a field about the status of smoking. Ex: Do you smoke? Yes (if yes nothing will happen) No (if no another field containig 2 other radio buttons and a text box will apear next to "no" button) How can I apply this trick to my database. Thank you.
backsmith Posted December 18, 2009 Posted December 18, 2009 Hi You could use conditional formatting to change the colour of the supplimetary questions dependant on the value of the smoking field. Or you could duplicate the layout and on the question.smoking layout add your extra questions. Make the yes smokimg answer a button that inserts the necessary value and changes to the questions.smoking layout. Or.. you could use a Show Custom Dialog to ask your extra questions. Calling it with a button as above. hope that gets you started.
RodSierra Posted December 18, 2009 Posted December 18, 2009 Your using FM10, so I'd setup a tab, one occurrence blank,the other with the additional fields. Label the tabs yes no in the object info window. Generate a script that goes to object yes or no depending on the content of the test field. Set script trigger for the test field to on object exit. Set fill and line colors to none and set the label width to 0 to hide the tab. You may also want to trigger the script on record load to insure the proper info is displayed when records are viewed. This is done at the layout setup window.
tolga Posted December 18, 2009 Author Posted December 18, 2009 Thank you for your quick replies. But I'm a little bit confused. The finest solution is "conditional formatting" I think. After trying a few attemts couldn' succed at all. Can you post me small example. Thank you
backsmith Posted December 18, 2009 Posted December 18, 2009 Here is a quick file. Its not as elegant as I forst thought because the fields are still enterable / editable even if they are whited out. John smoking.zip
tolga Posted December 18, 2009 Author Posted December 18, 2009 Thank you very muck, Backsmith. That' s it. You' ve saved my day. Thank you again.
bcooney Posted December 18, 2009 Posted December 18, 2009 (edited) The condt'l formatting idea isn't the best idea (although it looks like it is). As even backsmith says, "the fields are still enterable." Yikes! You might end up with odd data. Try Rod's idea of a hidden tab panel. This will prevent the user from accessing the irrelevant fields. PS: Demo has hidden tab panel. You don't really need object names, just go to a field in the desired tab. HiddenTab.fp7.zip Edited December 18, 2009 by Guest Only fair to post a demo
bcooney Posted December 18, 2009 Posted December 18, 2009 As soon as I posted this, I realized that you need to clear fields in case the user switches from Yes to No. And you'll probably want to provide a warning dialog. Working on a new demo...
bcooney Posted December 18, 2009 Posted December 18, 2009 New demo. My boss would kill me. He hates stuff like this...lol. HiddenTab.fp7.zip
tolga Posted December 20, 2009 Author Posted December 20, 2009 Hi Barbara, you're right. At first cond. formating seemed to be the best choice for me, but it wasn't (because of two reasons). Yes, as you said data entranca is still possible. And I have to use radio buttons in "show mode", but they still exist in the "hide mode". Your 1st example is nearly what I want. But in both situations (yes/no) there has to be a field (field 1 in yes, fields 2 and 3 in no). Is there a way to make one situation completely empty? Thank you again. And sorry for my late post.
bcooney Posted December 20, 2009 Posted December 20, 2009 If there's a third option (Yes No None), then when None is chosen you'll need to clear both tab panel fields, and perhaps set an empty tab panel to the front. FM isn't the best at disclosure. My instinct is to step back from this and see if you can simplify the data model. For example, I don't typically do a radio Y/N, but rather one numeric flag field, flag_IsSmoker which is set to 1 (use a value list that equals 1 and set the field to a checkbox).
bcooney Posted December 21, 2009 Posted December 21, 2009 Rereading your post, I think I've jumped to a conclusion. You do not need to have fields in both tabs. If there is no field in a tab, you WILL need to name the tabs and use Go to Object (bcs there is no field in the tab to navigate to). So, yes, you can have an empty tab panel.
Recommended Posts
This topic is 5451 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now