Newbies chickspirit Posted July 22, 2008 Newbies Posted July 22, 2008 I've created a database for potential sponsors and have a checkbox that when checked shows the potential sponsor has become an actual sponsor. I created a script and applied it to the checkbox so when the checkbox is clicked a new record is created in my confirmed sponsors database. I've applied the script to the checkbox and it works. The problem is it won't actually put a check in the checkbox to show they've become a sponsor. Is there a script action I can apply that allows a check to be put in the checkbox and also performs the script I've created? Thanks for your help.
Fitch Posted July 22, 2008 Posted July 22, 2008 Just add a Set Field step to your new record script. The value that it sets it to should correspond to the value list you used to define the checkbox. I typically make a value list called One, with a value of 1, which makes it very easy to work with the data in scripts and calculations. Also you'll want to add to your script some logic to deal with what happens if the checkbox is already checked/the record has already been created.
Lee Smith Posted July 22, 2008 Posted July 22, 2008 Have you tried the "Set Field (YourCheckBox; "YourAnswer") yet? Lee
Newbies chickspirit Posted July 22, 2008 Author Newbies Posted July 22, 2008 Thanks for the suggestion. In theory I understand what you're suggesting but because I'm a newbie I don't know how to actually put it into practice. I'm confused about the value list and the value. My value list is called Confirmed Sponsor. I only had one value listed which was confirmed sponsor. I changed the value to 1 to see if that would do it but it didn't. I guess I'm just not clear how to implement the set field so the checkbox gets checked before the rest of the script is performed. Also if the box is checked I'd like nothing but the box to get unchecked if it's clicked again. Can you suggest how I put that in the script as well? Thanks again for the help.
Lee Smith Posted July 22, 2008 Posted July 22, 2008 Both Fitch and I supplied essentially the same answer to your original question, which means that we both read it the same. Either paste a copy of your script, or your file, so that we can see what your script looks like. Lee
Newbies chickspirit Posted July 23, 2008 Author Newbies Posted July 23, 2008 Thanks Lee, here's the script Enter Browse Mode[] Set Field[Potential Sponsors::Confirmed Sponsor] Go to Layout["Confirmed Sponsor Detail" (Confirmed Sponsors)] New Record/Request Go to Field[Confirmed Sponsors::Company]
Fitch Posted July 23, 2008 Posted July 23, 2008 My point was that when you use the Set Field script step, you need to set the field to a value that belongs to your value list.* If "confirmed sponsor" is in the value list, you'd set the checkbox field to "confirmed sponsor." I used "1" as an example because it's good practice, although not applicable in every situation. I inferred from your first post that you were at least a little familiar with ScriptMaker. Take a look at the attached file and see if it makes sense. [color:gray]*It doesn't matter what your value list is called, but it does matter what the values are, because e.g. if your value list contains only the number "1" and you set the field to "1" it will show a checkbox, but if you set the field to "banana" the checkbox will display as empty, even though it actually contains the value "banana," because "banana" is not a member of the value list. checkbox.zip
Fitch Posted July 23, 2008 Posted July 23, 2008 In your script example you specified the field, but you didn't specify what data to put in it.
Newbies chickspirit Posted July 23, 2008 Author Newbies Posted July 23, 2008 Thanks Fitch that was so very helpful. It took me a minute to figure out what you did, this is my first day working with scripts, but I have it working exactly as I wanted thanks to your example. You just saved me at least a couple of days of stress and strife. :yourock:
Recommended Posts
This topic is 5969 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