Alpha Video Training
Results 1 to 4 of 4

Thread: Misbehaving Multistate Button

  1. #1
    Member
    Real Name
    Stephen Williams
    Join Date
    Apr 2000
    Location
    Oakland, CA
    Posts
    930

    Default Misbehaving Multistate Button

    I have the following code on a multistate button that is supposed to filter the table. Options are letters "A" to "Z". It is on a form, based on a set, the parent table of the set is my "Cust" table.
    Misbehaviors:
    1. Click on "A", it overwrites the customer name to "A". (yesterday. anyway)
    2. Click on "A", "A" flashes in the Last name field, but does not overwrite it, nothing else happens. Close the form, reopen it, it now shows only customers with "A*" last names. Better, but still no cigar.
    Code:
    ''XBasic
    'script for the multistate button app

    '' Filter the table
    ''
    topparent:tables:cust.filter_expression = "left(last,1) = '" + multistateBTN1.text + "'"
    topparent:tables:cust.order_expression = "LAST"
    topparent:tables:cust.query()
    ''
    '' Get the table handle from the form
    ''
    t = topparent:tables:cust.current()
    ''
    '' Get the current record count
    ''
    i = t.index_primary_get()
    count = i.records_get()
    ''
    '' If we found no records, then we put up a warning and show all records
    ''
    if count = 0
    ui_msg_box("Warning", "No records found. Showing all records")
    topparent:tables:cust.filter_expression = ""
    topparent:tables:cust.order_expression = "LAST"
    topparent:tables:cust.query()
    end if


    Blame Dan - he put it in the code archive!
    I am utilizing Dan's multistate button code, which works perfectly for him (do I have to pay Dan so it will work for me?)

    Stephen Williams

  2. #2
    Member
    Real Name
    Barry Rochford
    Join Date
    Apr 2000
    Posts
    452

    Default RE: Misbehaving Multistate Button

    That's the same coding I use (Dan & I must have both lifted it from the Alpha Samples). Try putting a debug(1) as the first line of coding and single step it through.

    You may find it's something on your form and not that you didn't send Dan the check.

    -Barry

  3. #3
    Member
    Real Name
    Barry Rochford
    Join Date
    Apr 2000
    Posts
    452

    Default RE: Misbehaving Multistate Button

    Something I also thought of, I always have the A-Z button on a form along with a imbedded browse that is read-only. Once you check on a letter "A", then you can dbl-click on the browse which takes you to the form with you selected record showing.

    -Barry

  4. #4
    Member
    Real Name
    Stephen Williams
    Join Date
    Apr 2000
    Location
    Oakland, CA
    Posts
    930

    Default RE: Misbehaving Multistate Button

    Thanks for the reply
    I tried putting debug(1) in and A5 locked up. I'm wondering if I have a proper install of A5 at this point - this behavior is TOO wierd...
    Steve

Similar Threads

  1. MultiState Button ?
    By Keith Hubert in forum Alpha Five Version 6
    Replies: 3
    Last Post: 01-24-2005, 11:28 AM
  2. Multistate button question
    By urbanski in forum Alpha Five Version 5
    Replies: 21
    Last Post: 04-13-2004, 09:21 PM
  3. Programing a multistate button
    By David Day in forum Alpha Five Version 5
    Replies: 8
    Last Post: 08-15-2002, 10:53 AM
  4. Multistate Button Problem
    By forskare in forum Alpha Five Version 4
    Replies: 8
    Last Post: 03-04-2002, 05:59 PM
  5. MultiState Button
    By nick marodis in forum Alpha Five Version 4
    Replies: 2
    Last Post: 01-31-2001, 05:25 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •