Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 3 of 3 total |
Filter problem |
Fri, Dec 16 2022 11:35 AM | Permanent Link |
Peter van Mierlo EVENTSOFT | Hi
I think I'm looking over something but can't see it anymore. My FORM has onKeyPress event to scan a barcode or nfc-tag. The result should not be visible to the user. So for testing the scan result is passed to a variable to use it in a database filter. See code below Because this gives an error message (see attachement) I tried the following variations. - assign scan result to a LABEL and use it in the filter -> result ERROR - assign scan result to a EDITand use it in the filter -> result GOOD Use LABEL and gives ERROR: dmMain.Scan.Refresh; dmMain.Scan.Filter :='LOWER(NumberBarcode) like LOWER('+QuotedStr(Label1.caption) +')'; dmMain.Scan.Filtered := True; User VARIABELE and gives ERROR: dmMain.Scan.Refresh; dmMain.Scan.Filter :='LOWER(NumberBarcode) like LOWER('+QuotedStr(sSenderBARCODE) +')'; dmMain.Scan.Filtered := True; User VARIABELE and gives WORKS: dmMain.Scan.Refresh; dmMain.Scan.Filter :='LOWER(NumberBarcode) like LOWER('+QuotedStr(Edit1.Text) +')'; dmMain.Scan.Filtered := True; What am i missing in this.??? Attachments: error.png |
Sat, Dec 17 2022 5:43 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Peter
My guess would be some "forbidden" character that TEdit blocks but TLabel or user variable doesn't. Try comparing on a character by character basis and see. Roy Lambert |
Mon, Dec 19 2022 10:44 AM | Permanent Link |
Peter van Mierlo EVENTSOFT | Hi Roy,
Yep...there was a ENTER at the end of the scanned nfc-tag/barcode. Problem is now solved using a additional Ttimer and code below. procedure TFormContactScanManual.FormKeyPress(Sender: TObject; var Key: Char); begin TimerMessage.Enabled := false; // reset interval if key= #13 then begin // Procedure for filtering databases ScanDataSearch; // Scan variabele leeg maken sSenderBARCODE := ''; end else begin sSenderBARCODE := sSenderBARCODE+Key; end; TimerKeyEmpty.Interval := 500; TimerKeyEmpty.Enabled := True; end; procedure TFormContactScanManual.TimerKeyEmptyTimer(Sender: TObject); begin if sSenderBARCODE <> '' then // to long delay begin sSenderBARCODE := ''; // als iets is gescanned zal dat onzin zijn end; end; |
This web page was last updated on Tuesday, April 23, 2024 at 08:10 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |