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

Find Scripts that go to Find Layout w/Date & Number fields

Status
Not open for further replies.

mcarey

Instructor
Feb 13, 2002
7
US
I have read many descriptions of setting up good Find Scripts...including Dave Osborne's the Ultimate Find. Many of them suggest taking the user to a separate find layout w/ only the fields they need. The Find layout has a Cancel button and Continue button. Many of my solutions have such a script. But I have a recurring problem that if my find layout has number or date fields I run the risk of stranding the user if......they type a non date or non number in those corresponding fields and then immediately click the Continue button without clicking somewhere else. Filemaker give the bad format dialogue box for number or date.....but there is no error number to trap for. Therefore the user is dropped out of the script and eventually depending how they handle the FileMaker dialogue boxes is stuck ....

If you would like I could post the scripts I am using.

Thanks for any help you can offer.

Does anyone have any suggestions on how to rectify this?
 
You have to 'hide' the staus bar - users have no access to Continue button - and script the 'continue' with error trapping.

Place the 'Find' button on the layout, together with a 'stop' button.

You need 3 layouts for this and 3 scripts...

If you want I can send you a sample....

HTH

JW
 
Thanks, but I am afraid I didn't explain myself. You wrote: "You have to 'hide' the staus bar - users have no access to Continue button - and script the 'continue' with error trapping.
Place the 'Find' button on the layout, together with a 'stop' button.
You need 3 layouts for this and 3 scripts..."

I do have the status area hidden. The user clicks a FIND button from the Detail Layout. They are taken to a FIND LAYOUT brought into Find Mode and paused. At the bottom of the FIND LAYOUT there are two buttons. One is called 'Continue" at the script behind it is just 'Resume Script". The other button is called "Cancel" and it cancels the script and takes them back to the Detail Layout. My problem is how to script for a number and date field that is in the Find Layout. If the user types a non date or non number and then immediately clicks on the Scripted Continue Button they are taken out of the script and given the FileMaker Warning that they have entered a value that is not formated properly. I have not been able to trap for this problem. The only soluiton I have come up with is to use a different date field that is actually formatted as a text field then use the Not Is Valid (text to date(textfield)) to trap for the bad date ..if a bad date is found I then perform the find and run the Find Script again...until the date is entered correctly then I set the actual date field from the DateText field, clear the Date Text field and perform the find. I am now limited in some other things I wanted to do but this seems to solve the problem.....But there must be a better way.

Yes I would be interested in seeing the three scripts you spoke of if you still think they will help.

mcarey@cccoe.k12.ca.us
 
. If the user types a non date or non number and then immediately clicks on the Scripted Continue Button they are taken out of the script and given the FileMaker
. I have not been able to trap for this
-Set Error Capture On and capture the error...IF error is there then pause the script or go back one step and have them try again
 
A couple of ideas I have on this is to restrict the input to date and numbers.

First the date. Go to the define field, select your date field and click on options. Click on the Validate tab and select the appropriate date format restrictions. Also check the strict: do not allow override and then type in an erro message on the bottom option to tell the user what they have to do. Unless a valid date is entered they can't get past this field doing this.

Next, if you format a number field to only accept numbers, I could enter in 1452s5tg25 and what will display is 1452525. Do this in layout mode by right clicking on the number field, select the number format option, select format as decimal, 0 fixed number of decimal digits and this field only see number characters. The reality is the letters may be held in the field though they are not displayed so I'm sure if a script will read numbers only or not. But it's worth a look.

Let me know what happens and I may think of some other options for you.

Marty
 
File is on his way....

My mistake, you need 4 layouts, not 3....

Error trapping is in the script and redirect you to the right layout to take the appropriate step...

HTH

JW
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top