Jump to content

clear field with radio button?


harry8

This topic is 8102 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have two radio buttons: 'print' and 'complete.' When the 'complete' radio button is clicked, I want the 'Days Past Due' field (which has a calculation) to clear (or show zero). How do I do this? thanks!

Link to comment
Share on other sites

Do you want the field cleared of data? Thus losing the information about previous past due status.

Or do you simply want the "Past Due" field to show as up to date? Simply masking the information?

If the former, then you will need to script the procedure.

If the later, then you will need a display field to actually show the current status. Such as:

code:


PastDue_display = If ( Completed = "Yes", "", DaysPastDue )

Link to comment
Share on other sites

No new radio buttons or fields will be created or moved. The radio buttons already exist -- 'Print' and 'Complete' (one value list). They are in the middle of the page and also are part of a field called 'Notes Office.'

The field "Days past due" exists and is to the right of the page (DB layout). I want the 'Complete' button to talk to the "Days past due" field" -- and clear it.

thanks, Harry

Link to comment
Share on other sites

I cannot use a new field. The 'Days Past Due' field is no longer relevant when the "complete" button is chosen -- 'complete' means the bill has been paid. Therefore, a blank 'Days Past Due' field, or a zero, will work fine.

thanks, Harry

Link to comment
Share on other sites

I'm not clear on what you are saying and how it relates to what I've written. I don't know what "lay a button over the field" means. As I said, I don't want to move buttons -- sounds like you are asking me to do that. The button already exists... I guess my new question is: Can I click a button that is in its own field and have it affect -- clear -- a different field. Sounds like you are saying that it cannot do that.

Thanks, Harry crazy.gif

Link to comment
Share on other sites

Harry,

What CaptKurt is saying does not mean you need any more fields.

The problem is your days past due. You say this is a calculation.

What is it calculated on.

If it is a calculation field, cant you add in

If( Complete="Yes", "", Show past due days)

If it is not a calculation field then do the following.

Basically, create an object (a rectangle will do) that sits over the top of your Yes option on your completed field.

Now, write a script

Set Field (Completed) "Yes"

Set field (Days past due) ""

Now, the rectangle you placed over the yes option on your completed field, click on it and choose format > button.

Choose perform script > the one you just wrote.

You can then set the fill and border colour to transparent.

Link to comment
Share on other sites

Kicking and screaming I have pretty much tried all the ideas that have been presented to me. I would have preferred a calculation, because that seemed to be the least messy solution. I have not had any success. I have been encountering 'too few separators' messages along with 'circular reference' messages as well as 'an operator expected here' messages.

My final attempt for the day was the Scriptmaker route -- here's my script:

Set Field ["(Notes Office) and "Complete" "]

Set field ["(Days past due) = "" "]

The 'and' and the '=' I guessed at because I was asked by the app to add an operator. I also created the invisible rectangle over the 'Complete' checkbox. All to no avail -- it doesn't work. Fortunately I had time to spend with this today -- major trial and error. Usually I can begin to start figuring these things out, but this one has me stumped.

My next try may be to make a simple trial DB and ad these calcs and scripts and see if I can get it to work. Your assistance is and has been greatly appreciated.

Thanks, Harry

Link to comment
Share on other sites

quote:

Originally posted by Harry JJ:

I have two radio buttons: 'print' and 'complete.' When the 'complete' radio button is clicked, I want the 'Days Past Due' field (which has a calculation) to clear (or show zero). How do I do this? thanks!

Starting over:

The calc for DaysPastDue =

If(Complete = "Yes", "", whatever the original calc is)

That way, if the "Yes" answer in the "Complete" field is checked, DaysPastDue will be empty; otherwise, it will show the result of the calculation.

***********************

It seemed to me that this was an easy one; I guess I was mistaken.

Link to comment
Share on other sites

Following is a calculation from the 'Days past due' field. It needs separators. I don't know if the last line is legitimate code. I don't have a "yes" button, just 'Print" and "Complete" buttons that are within the 'Notes Office' field.

If(Today-Sort Date-30>0, (Today-Sort Date-30), "0" or

Case(Today-Sort Date-30>0, (Today-Sort Date-30) >=0, "0" and

If( Notes Office , "Complete" ) , Days past due , "" )))

How does this look or am I barking up the wrong tree? thanks

Link to comment
Share on other sites

One field called DaysPastDue =

code:


If(

Today - Sort Date - 30 > 0, (Today - Sort Date - 30), "0"

)

Another field called cPastDue_display =

code:


If(

Notes Office = "Complete", DaysPastDue , ""

)

Mixing both into the same field is a sure way to confuse and lead to errors.

Link to comment
Share on other sites

Your solution is simple -- I like that. Let's try to make it work. The "Complete" button is in the "Notes Office" field. Here's how I wrote it:

If(Notes Office = "Complete") , "", or

If(Today-Sort Date-30>0, (Today-Sort Date-30), "0" or Case (Today-Sort Date-30 > 0, (Today-Sort Date-30) >=0, "0"))

I'm receiving the dialog box: "There are too few separators in this function." How can I make it work?

thanks, Harry

Link to comment
Share on other sites

Sorry if I broke the rule. I decided to post in both places since I began both topics and the problem I was having was also directly relevent to my 'calculations-separators' topic in Fields. Now that I understand that the same users view both, I will not do that again.

Anyway, after I went through much trial and error, danjacoby appears to have solved my problem with this calc:

Case (Notes Office = "Complete", "",

Status(CurrentDate) - Sort Date-30>=0, Status(CurrentDate) - Sort Date-30, 0)

Thanks much to danjacoby, and to all who assisted. I'm sure I'll be back.

Harry

Link to comment
Share on other sites

This topic is 8102 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.