Re: Locate a Record Problem (Nearly Solved)
toggle quoted messageShow quoted text
I've found a way around the problem, but it only works for programs with 1 parameter passed on. I removed the Expressions in the From and To fields, and put an expression in the Tasks/Range/Locate Range Expression area instead.
I simply used If(pPart Number=' ',Part Number = Part Number, pPart Number = Part Number) This now allows Locating in Tables with or without parameters passed to them.
But I have some programs with multiple parameters passed to them and it is only recognising the first part of the expression. I used the following expression:
If(pAircraft Reg= ' ', Aircraft Reg = Aircraft Reg, If(pAircraft Reg <> ' ' ,pAircraft Reg = Aircraft Reg, If(pPart Number = ' ' ,Part Number = Part Number, if(pPart Number <> pPart Number = Part Number, If(pSerial Number = ' ' ,Serial Number = Serial Number, if(pSerial Number <> pSerial Number = Serial Number,0))))))
Now the Locate function works, but the passed parameters are being ignored except for the Aircraft Reg part. (This was initially at the end of the expression, and when it didn't work, I moved it to the start of the expression, and it then worked, eg, initially I was getting all Aircraft in the data view, and when I changed the expression, I was able to filter it to the aircraft I want, but for the Part Number ans Serial Number part of the expression, I am still getting everything in the data view. Not all of the parameters are being used all the time, some of them are skipped in the arguments section.
I'm sure that it doesn't like my expression format, but I'm not sure how to fix it. If anyone there can understand what I am trying to do here, I would appreciate help that with an expression that will allow all the passed parameters to be filtered as necessary.
On Tuesday, 3 September 2019, 7:21:21 am AEST, buster reinke via Groups.Io <buster_png@...> wrote:
Further to this, it wasn't my expression causing this. It appears that if any of the files are using passed parameters to it, the locate to function will not work unless the * is placed after the ficure entered into the locte field. Maybe it is a bug after all.....This explains why some of my tables will locate properly, and some wont.....
On Tuesday, 3 September 2019, 7:14:23 am AEST, buster reinke via Groups.Io <buster_png@...> wrote:
Hi Govert, I've worked out what's causing it, I just now need to find a solution. I have been trying to use the same program files whether they are accessed directly, or if they are using papameters passed to them:
So in the range from field, I have used the expression "IF(pPart Number=' ','0',pPart Number"
In the range to field, I have used "IF(pPart Number=' ','ZZZZZZZZZZZZZZZZZZZZZZZZZ',pPart Number".
This allowed me to get the table to ignore the Parameters if I accessed the table directly, but this is what is interfering with the Locate a Record function.
I could just create several files, some with the required parameters, and some without, and link them to the programs that call them, but that means I can't just make any programming changes in the one place if required.
Do you know another way I can use the same file, whether passed parameters are used or not?
On Tuesday, 3 September 2019, 6:53:33 am AEST, buster reinke via Groups.Io <buster_png@...> wrote:
Hi Govert, they are Alpha fields I am trying to locate on. They are all Key Indexes, but I just tried using the * after entering the first digit, and that worked.
On Monday, 2 September 2019, 8:59:03 pm AEST, Govert Schipper <govertschipper@...> wrote:
Is the field you are locating on an Alpha field? If it is Numeric, you will have to type the whole value
Is the field you are locating on the first or only key segment? If not, you might try to use an * right after your value
Van: email@example.com <firstname.lastname@example.org> namens buster reinke via Groups.Io <buster_png@...>
Verzonden: maandag 2 september 2019 12:31
Aan: email@example.com <firstname.lastname@example.org>
Onderwerp: Re: [magicu-l] Locate a Record Problem
Hi Keith, yes, I have Indexes on the Fields I am trying to search on. They are Alpha Fields. I have just found that if I type in the entire contents of a field eg "2622311-16", it will take me to the record, but if I just type 26 and hit locate, it takes me back to the start. It has me buggered, other Line Tables are working perfectly.
On Monday, 2 September 2019, 8:11:00 pm AEST, Keith Canniff <kcanniff@...> wrote:
From: email@example.com <firstname.lastname@example.org>On Behalf Of buster reinke via Groups.Io
Hello all, I am having a problem with the Locate a Record function for some Tables. Some Line Tables work with no problems. It always takes me to the first record when I enter the first digit, but for other tables, it always takes me back to the 1st record. Some of my Screen tables will Locate a Record providing I am only trying to Locate on the first field. I can't see any differences in the Line Tables that the Locate a Record work on, but I know I must have missed something. Does anyone have any idea what could be causing only some Line Tables to Locate correctly on all fields, and none of the Screen Tables to work correctly?