QuickCompare

Viewing 2 reply threads
  • Author
    Posts
    • #3691
      Barry Wood
      Participant

        Hi

        I have a dbgrid that displays records of events and has a field called ‘Venue’. That field can only have 2 values ‘HOME’ and ‘AWAY’.

        I’d like to use QuickCompare to highlight all the records that are at ‘HOME’ .

        So I Set FieldName as ‘Venue’, under FieldValue I set Type to ‘String’ but it immediately reverts to <unknown>.

        If I set FieldValue to ‘HOME’ I immediately get en error msg ‘Could not convert variamt of type (String) into type (Double). I can’t them remove this value as the error is persistent and eventually I have to close the form or (more often) Delphi.

        As QuickCompare has a Type setting for various field types (and my field is a String), how can I use a value of ‘HOME’ or ‘AWAY’ to do a compare?

      • #3693
        Ray Konopka
        Keymaster

          Hi Barry,

          I see the same behavior. I think the issue is in the built-in Variant property editor. In looking at the code for the QuickCompare functionality, there does not appear to be any assumptions that the FieldValue has to be a number.

          Have you tried setting the FieldValue at runtime in the FormCreate event handler. I wonder if that would work properly for you.

          Ray

        • #3694
          Barry Wood
          Participant

            Ray,

            Setting them in the form activate works fine. Thanks for the tip.

        Viewing 2 reply threads
        • You must be logged in to reply to this topic.