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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

radio button automation

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,
I want to automatically fill radio buttons.
To be specific
I have fields called intime & outtime & their difference i am calculating in other field called timeinterval.
i have one more field called waitingtime which is a radio button.It has 3 options
1)<5
2)5-10
3)>10
I want that when difference in timeinterval field is <5 than option one should be automatically selected.
If the difference is 6 then option 2 should be selected & if greater than 10 then 3rd option should be selected.
 
Sorry I used the wrong variable in my testing but use this code as the default value of your radio button. Just change &quot;waitingtime&quot; to &quot;timeinterval&quot;.

@If(waitingtime<5;&quot;<5&quot;;waitingtime>10;&quot;>10&quot;;&quot;5-10&quot;)
 
i am getting the error comparison operators must be supplied with the same number
 
Can't say as I'm familiar with that error. It didn't come up in my testing. What's your formula for time interval?
 
For In time there are two fields i.e Hrs1 & Hrs2
For Out time Hrs2_1& Min2_1

Formula for time interval is
as follows:-
@If(Hrs2_1<Hrs1;&quot;Error&quot;;Min2_1 != &quot;&quot; &Hrs2_1!=&quot;&quot; &Min1!= &quot;&quot; &Hrs1!=&quot;&quot;;
(Hrs2_1*60+Min2_1) - (Hrs1*60+Min1);diff )
 
Do your in and out time fields have default values? Otherwise I can forsee someone not entering an hour value for an issue that took less than 60 minutes. If that happened you'd get forced to 'diff' and I'm not sure what that does or means.

Is the formula defined for default value of time interval or are using an assignment :)=)?

Otherwise (Hrs2_1*60+Min2_1) - (Hrs1*60+Min1) this looks like it would generate a good number. Did you put quotes around the <5 & >10 in the formula? There should only be quotes around the values, not the variables.
 
i tried with this formula also (Hrs2_1*60+Min2_1) - (Hrs1*60+Min1) but still it gives me the error &quot;Comparision operators must be supplied two values of the same data type&quot;
i have put quotes around the values only & not the variables.
I am defining this formula in the default value.
 
If timeinterval is being evaluated as a string and not a numeric variable that would be the problem. Try recreating the formula I originally gave you, except use the fields & functions button to paste in your timeinterval field.
If that doesn't resolve it, try assigning timeinterval a value bt default instead of a formula and see if the error goes away.

you can contact me direct at jhughes@barbhosp.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top