Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Performing a FIND and using set field - wont work


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

Recommended Posts

Posted

Hello: I have a button that brings the user into the correct layout and enters find mode. The user then types in a date range search 1/1/03...1/23/03 and hits a button to create the report. What I need is for this date range to be copied into a field so it appears on the print layout to show this search range. I tried to use set field then perform find but that didnt do it. How can I do this? Thanks

Posted

I would either use two globals, one each for the starting and ending date, or Copy[] and Paste[] this information on a layout which holds both fields.

Posted

I wanted to use the copy and paste. What I tried to do - the user enters the layout in the find mode, the user types in 1/1/03...10/1/03 into the field and then hits the button to generate the report that script is something like

copy [select,field]

perform find []

paste [select,field2]

I'm using a PC (if that makes a difference). When I try to run this is acts like it cannot find any matching records. I can manually perform the task -- type in date range, then copy then perform find and finally paste in my other field. How could I do this correctly if it can be done?

I tried to use a modify last find but then it omitted the found set but returned the date range! Thank You

Posted

Hi:

I would go with JT's suggestion of using two globals for the from and to ranges, then setting your date field to that range. Then you can just put those two globals on your report layout. Just to be clear, the procedure would be something like this:

1. User puts ranges is global date fields: "gFromDate" and "gToDate" and executes find script

2. Script goes:

Enter find mode [ ]

Set Field ["DateField" , "gFromDate & "..." & gToDate"]

Perform Find [ ]

Go To Layout [report]

You might want some error capture in there and other stuff

Posted

One small modification to Ken's steps:

Set Field ["DateField", "DateToText( gFromDate ) & "..." & DateToText( gToDate )"]

Dates are actually numbers to FileMaker, so they must be converted to text if you're using them in anything other than a single date calculation.

Posted

-Queue- said:

One small modification to Ken's steps:

Set Field ["DateField", "DateToText( gFromDate ) & "..." & DateToText( gToDate )"]

Dates are actually numbers to FileMaker, so they must be converted to text if you're using them in anything other than a single date calculation.

Hi Queue ...

Are you sure this will work? I've never been able to use a SetField in Find mode using the method you describe for searching on date ranges. I always get an error message to the effect of "No valid criteria were entered".

Instead, I've always had to go to a Layout (in Find mode) containing the date field being searched on, and use the following:

Insert Calculated Result [ date, DateToText(g_begindate) & "..." & DateToText(g_enddate) ] [ Select entire contents ]

Am I mistaken about this?

mzimm: see attachment

date range search.zip

Posted

I did not get the setfield method to work. Using Ken's script it only searched on one of the date ranges and Queue's additions gave me some sort of total of the dates and returned a "no records found error".

Posted

Got it to work! I didnt have the date field in my report layout when I tried to use insert calc results. Thanks for all your help guys!

Mike

Posted

Yeah, I wasn't paying attention to the step Ken used, just the parameters in the function. I'd already answered the Insert Calculated Result [ ] question in another thread before this one, and just took it for granted that had already been clarified. Whoops!

This topic is 7711 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.