Alpha Video Training
Results 1 to 2 of 2

Thread: Multistate Button

  1. #1
    Real Name
    Lanny Tonning
    Join Date
    Jun 2003

    Default Multistate Button

    Well, I've figured out what happened, but I don't know why it happened. My Alpha Sports- modeled MSB to look up people by letter groups worked well. K brought up the last names starting with K. All the letters did their jobs on the embedded browse.

    Then it stopped working and I had to refresh the browse each time or the second letter used for a query would come up zero because no name starting with that letter were in the query that the previous button push created.

    I tried code. Not good at it. Drug out the Action Scripting manual and - no joy there.

    Then I went back and opened the databases in V6 instead of V7 and everything worked as advertised.

    So, it turns out the tipping point on this function was the upgrade to v7.

    Now that I know when this happened and what was involved, does anyone know why it happened?


  2. #2
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Join Date
    Mar 2006
    Los Angeles

    Default Re: Multistate Button

    Hi Lanny,
    I had the same problem yesterday when I brought my v6 file into v7. I think the query list gets filled. The query was being generated but the browse reverted to record number order instead of using the query. I added a tbl.query_detach_all() to the beginning of the multistbtn1 OnChange script and added query.options = "M" to the query_create() definition. Oh, and I rebuilt all the indexes just in case. It seems to be working now...

    Here's my Xbasic (working from memory):
    dim tbl as p
    tbl = table.current()    'or use tbl = table.get("directory") if a child
    query.filter = "left(company,1) = var->vcLetter"
    query.order = "Company"
    query.options = "M"
    idx = tbl.query_create()  
    recs = idx.records_get()
    if recs < 1 then
      ui_msg_box("Query Result","No records found"+crlf()+"Showing all records",0)
      multstbtn1.text = "1"   'this releases the button pressed
    end if
    Last edited by MoGrace; 08-03-2006 at 06:24 PM.

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

Similar Threads

  1. Multistate Button
    By Lanny Tonning in forum Alpha Five Version 7
    Replies: 2
    Last Post: 08-02-2006, 10:44 PM
  2. MultiState Button ?
    By Keith Hubert in forum Alpha Five Version 6
    Replies: 3
    Last Post: 01-24-2005, 11:28 AM
  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


Posting Permissions

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