LindaG Posted August 1, 2003 Posted August 1, 2003 Hellow everyone on Forums, I have a problem. I've created several buttons with scripts and some of them don't work right. I really need some help figuring out the problem, please. User creates a new record by clicking a button. If, instead of working on new record (which requires the first field in tab order (Division) be filled in (via Validation Not Empty), User instead clicks the Menu button, nothing happens. No error message that Division can not be empty, nor does it run the Menu script. Two of my buttons (if clicked immediately after creating a new record) will produce the Validation error message (delete and list scripts) just fine. But three of my buttons do nothing
-Queue- Posted August 1, 2003 Posted August 1, 2003 Go to Field[] script steps with no field specified will force an exit of the record, triggering the validation. Clicking a button with the cursor in a field will not exit the record unless you tell it to do so. After user clicks New Record, why are you performing a Go to Field[] with no field specified? This will force the validation to occur (and fail) immediately. If you meant Go to Field[Division], then you'll need Go to Field[] at the beginning of your other scripts to force the validation to occur.
LindaG Posted August 1, 2003 Author Posted August 1, 2003 Thank you for responding, Queue. Well, I had the Go To Field[] at the end of the New Record script because I didn't want it to pop the menu on Division. I wanted the User to be able to start entering information in any field they wanted. I guess that's not a good idea. However, when I remove Go To Field[] from New Record, it pops the Division field, but if I immediately click the Menu button STILL nothing happens! No Validation Message and no menu switch. I thought there might be a glitch (or some hidden script attached) so I deleted each button and recreated them with the same results. I then tried adding a Go To Field[Division] right after the New Record. Same thing ... it pops the field but if I click Menu, nothing happens and no validation message. I just don't get it. Same with clicking 'New Record' and 'Search'. I'm lost. Linda G
-Queue- Posted August 1, 2003 Posted August 1, 2003 Again, Menu needs a Go to Field[] step to force the validation. You can remove the pop up menu field from the tab order and it won't pop up by itself, or you can put a Go to Next Field[] after New Record/Request to force the cursor to skip to the second field in the tab order.
ernst Posted August 1, 2003 Posted August 1, 2003 Hi Linda, I managed to reproduce your problem when another scrip, including the 'Set error capture ON' scriptstep, was being paused whilst clicking the MENU script. You can see this easily if the 'Continue' button is present in the status area. Could this be it? Regards, Ernst.
-Queue- Posted August 1, 2003 Posted August 1, 2003 I thought about error capture, but it doesn't appear to be present in her scripts, and it wouldn't influence the appearance or lack thereof of the 'Continue' and 'Cancel' buttons in the status area. Allow User Abort[] would do that.
ernst Posted August 1, 2003 Posted August 1, 2003 >>it wouldn't influence the appearance or lack thereof of the >>'Continue' and 'Cancel' buttons in the status area. I know, I just meant looking at the 'Continue' button as a way to see if a there was a -paused- script. And if so, the error capture state invoked by that script would still be active as well. Ernst.
-Queue- Posted August 1, 2003 Posted August 1, 2003 Ah, in which case setting the buttons to Halt currently active script whenever clicked would remedy the situation.
LindaG Posted August 1, 2003 Author Posted August 1, 2003 Ernst and Queue, thank you both for the ideas. I actually left off the leading two commands on all my scripts - Allow User Abort[On] because I'll need it and Set Error Capture[On] although I've never known what to do with it yet. Okay, I added Go To Field[] at the first of the Menu script and removed it from New Record and removed Division from the tab order. So now New Record ends with Add Record/Request and Menu starts with (after Allow User and Set Error) Go To Field[]. Now, the second field (also a popup menu) pops open. I don't want that either if I can help it. And still, when clicking Menu, I get no validation. Ernst, there is nothing else running (or even in this db yet) but just to be sure, I displayed the status area and watched. Nope. LindaG
ernst Posted August 1, 2003 Posted August 1, 2003 Not completely. Halting the currently active script will indeed stop the error capturing, but then the script will produce a 'goto layout has been cancelled, do you wish to...... blah' message, followed by the normal validation error. So imo best would be to start the MENU script with your 'goto field' , or 'exit record' followed by: if status(current error) >0 display an error message goto field division end if But maybe this is not the problem at all, so let's just wait and see... regards, Ernst.
ernst Posted August 1, 2003 Posted August 1, 2003 Hey Linda, Seems that we are all typing at the same moment. Can get confusing... I do not completely understand though, do you have the 'allow user abort' and 'set error capture ON' scriptsteps at the beginning of al your scripts? or not? Please elaborate... Ernst.
LindaG Posted August 1, 2003 Author Posted August 1, 2003 Oh I am learning so much from this. Okay, I modified my Menu script and it now reads: Go To Menu Set Error Capture [ On ] Allow User Abort [ Off ] Go to Field [ ] If [ Status(CurrentError) > 0 ] Show Message [ Buttons: "Finish New Record", "Cancel New Record", ""; Data: "You must either complete this New Record or Cancel the New Record creation. Which do you want to do?" ] If [ Status(CurrentMessageChoice) = 1 ] Go to Field [ Division ] End If End If Delete Record/Request [ No dialog ] Go to Layout [ Menu ] Set Zoom Level [ 100%, Lock ] Show All Records And guess what? It works!!! However, something is wrong because regardless of which message button, it takes me to the Menu, but I'll figure that out! The point is ... it forces validation if I click Menu (and the crowd goes wild!@!!) I even added back Go To Field[] at the end of the New Record script so it doesn't terrify us. Okay, so forcing field validation ... I will attach this to each of my scripts whenever I have a 'field definition' level of validation applied to a layout. Thank you again for making my day! Yes, we're typing at the same time, sorry. I have Error Capture [On] and User Abort[Off] on all my scripts. Sorry for being unclear. Linda Gent
LindaG Posted August 1, 2003 Author Posted August 1, 2003 Sorry that Go To Menu is just the name of the script. It just prints that when I print to text printer.
LindaG Posted August 1, 2003 Author Posted August 1, 2003 I added an Exit Script after the Go To Field [Division] and it works perfectly! Thanks to both of you! Linda Gent DAC
Recommended Posts
This topic is 7788 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