Alpha Video Training
Results 1 to 4 of 4

Thread: MultiState Button ?

  1. #1
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default MultiState Button ?

    Hi All,

    Here is the code I am trying to use in the OnChange event of a Multistate Button. Please can someone advise my what is wrong with it as to why I cant get it to work like it should. It is simply not updating the Browse like it does in AlphaSports.

    There is an Index on field name2.

    '' Filter the table
    ''
    topparent:tables:customer.filter_expression = "left(name2, 1) = '" + mulstbtn1.text + "'"
    topparent:tables:customer.order_expression = "name2"
    topparent:tables:customer.query()

    ''
    '' Get the table handle from the form
    ''
    t = topparent:tables:customer.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:customer.filter_expression = ""
    topparent:tables:customer.order_expression = "name2"
    topparent:tables:customer.query()

    end if

    Thanks in advance.

    Regards

    Keith Hubert

    Guild Member
    London.

  2. #2
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default RE: MultiState Button ?

    ""t = topparent:tables:customer.current()""

    This snippet is not found in the AlphaSports Customer Information form.

    I don't recognize this method. Suggest you verify that this actually serves to establish a valid pointer to the Customer table.

    I would have thought

    t = table.current() would suffice

    -- tom

  3. #3
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default RE: MultiState Button ?

    Tom,

    Thanks for making me look at the code again.

    This works.

    dim tbl as p

    tbl = table.current()

    ' Filter the table
    topparent:tables:customer.filter_expression = "left(name2, 1) = '" + mulstbtn1.text + "'"
    topparent:tables:customer.order_expression = "name2"
    topparent:tables:customer.query()

    ' Get the current record count
    i = tbl.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")
    tbl.order(name2)
    browse1.refresh()
    mulstbtn1.text = "1" '' I chose '1' because it is not in the set A-Z that we display
    end if

    Regards

    Keith Hubert

    Guild Member
    London.

  4. #4
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default RE: MultiState Button ?

    This is very Strange. I can only get the Multistate Button to work if I create it twice on the same form and both are running the same script with AS.

    Any ideas?

    Regards

    Keith Hubert

    Guild Member
    London.

Similar Threads

  1. Multistate button question
    By urbanski in forum Alpha Five Version 5
    Replies: 21
    Last Post: 04-13-2004, 09:21 PM
  2. Programing a multistate button
    By David Day in forum Alpha Five Version 5
    Replies: 8
    Last Post: 08-15-2002, 10:53 AM
  3. Multistate Button Problem
    By forskare in forum Alpha Five Version 4
    Replies: 8
    Last Post: 03-04-2002, 05:59 PM
  4. MultiState Button
    By nick marodis in forum Alpha Five Version 4
    Replies: 2
    Last Post: 01-31-2001, 05:25 AM
  5. Misbehaving Multistate Button
    By Stephen Williams in forum Alpha Five Version 4
    Replies: 3
    Last Post: 08-30-2000, 02:51 PM

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
  •