August 21, 200322 yr Greeting! I'm setting up a searching script to allow user searching in a date range. I use two global date fields to hold the beginning date and the finishing date. The problem is: I cannot enter anything in these two fields in find mode.
August 21, 200322 yr Welcome! Finding in globals won't work. Know why? Because globals are the same for all records. You want to enter the dates in these globals, then go into find mode If you want to find a date range of one field from two globals, you would want to do something like this: Go to Layout [Layout that the date field is on] Enter Find Mode [ ] Insert Calculated Result ["Date field you want to find in" , "DateToText(g_datefield1) & "..." & DateToText(g_datefield2) Perform Find [] Where g_datefield 1 and 2 are your two global date fields I just did this off the top of my head, so make sure you test it. Ken
August 21, 200322 yr Author Thanks Ken. So it means I cannot put other fields (not global) in the same layout.
August 21, 200322 yr You would want a specific layout with only those globals used for your find criteria, yes. Otherwise, you run the risk of changing valid data in other fields.
August 22, 200322 yr Author Thanks Queue. guess I have to use a calendar instead of manually enter date. b/c I need to put some other fields with these two.
August 22, 200322 yr Well, you could put nonglobals on the same layout, but you'll want to disallow entry, to prevent them from being accidentally modified.
August 24, 200322 yr It seems to me that this question has gotten a bit off track. To search for a date range, you can enter the start and end dates in global fields while you are in browse mode. Then, run a script that switches to find mode, and possibly switches to another layout with the actual date field that you want to search. Then use the "Insert Calculated Result" script step to pu the find criteria into the date field: Enter Find mode Go to Layout [DateFindLayout] Insert Calculated result [DateField, gStartStart & "..." & gEndDate] Perform find Go to Layout [original layout]
August 25, 200322 yr This was already explained, and further questions were closely related and hardly off-track for this to perform as desired without screwing up existing data. So why the need for a duplicate post?
August 25, 200322 yr Guilty as charged. I brought it up again partly because the thread got long enough that I had forgotten Ken's original explanation, and also it appeared that there had been some comments that had misled Newcomer into thinking that (s)he needed to do something a lot more complicated than necessary.
August 25, 200322 yr Yes, I was thrown off by the whole "Can I not put fields other than global fields on the layout?" question. I have two globals set up in the upper right corner of my layouts - a sort of quick range find. So in this case, the globals can be on the same layout as the other fields. JT seems to be talking more about a search layout, in which case it is good to use all globals and set your fields to their values. Ken
August 26, 200322 yr Agreed, I was just trying to help prevent what sounded like a catastrophe in the works.
Create an account or sign in to comment