Normal Topic Auto Table View Help (Read 1378 times)
UPaul42
Junior Member
Members
**
Offline


been a Q&A user/programmer
since version 2.0

Posts: 57
Location: Broad Brook CT
Joined: Jul 23rd, 2003
Auto Table View Help
Nov 21st, 2005 at 10:42pm
Print Post Print Post  
I wish to have a command button:

Open a Form
Retrieve all records
Open a Table View
Sort the table on the first column (ascending)

The purpose is to allow a user to see all the records in a table, sorted, prior to searching of adding more records.

I can get the form to open using programming
I can get the data to be retrieved using a deferred macro call
I can get the sorting done using a deferred macro call

How can I get the table to display (program a (Shift F6)?
  

&&http://www.lantica.com/images/sespro_badges/sespro3.gif&&Paul Anderson&&President&&Systems-Consulting&&89 Main Street, Broad Brook CT 06016&&(860) 627-5393&&Sales@Systems-Consulting.com
Back to top
IP Logged
 
Alec
Lanticans
*****
Offline



Posts: 200
Location: Ascot, England, UK
Joined: Nov 22nd, 2002
Re: Auto Table View Help
Reply #1 - Nov 22nd, 2005 at 10:58pm
Print Post Print Post  
Paul -

I suggest you abandon macros and instead use programming. Use SelectTreeItem calls. Rehearse the actions you need to perform, using in all cases the menu tree. Then repeat those actions as SelectTreeItem commands.
There are numerous examples here in the forum and more still in Inside Sesame. There's also the Programming Guide.
  

Alec
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Auto Table View Help
Reply #2 - Nov 22nd, 2005 at 11:05pm
Print Post Print Post  
Quote:
How can I get the table to display (program a (Shift F6)?


Code
Select All
var aa as int

aa = @SelectTreeItem("Search Update Menu!Other Commands!Table View (Shift-F6)")
 

  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
UPaul42
Junior Member
Members
**
Offline


been a Q&A user/programmer
since version 2.0

Posts: 57
Location: Broad Brook CT
Joined: Jul 23rd, 2003
Re: Auto Table View Help
Reply #3 - Nov 23rd, 2005 at 3:11pm
Print Post Print Post  
A restating of the concept.

Note: macros are not now being used, even though they do work.

Open a Form
Retrieve all records
Sort the results
Open a Table View

There is a form open with only command buttons on it.

The command button in this instance opens the desired form using
vMenu = @SelectTreeItem("Hachibur!Forms!Search/Update!Hachibur!HachiburReview")

Now we have a different form open ("HachiburReview") and I would expect that any addtional programming listed for the command button from the default form has stopped since we are now in a different form.

I plan to use the following code when the form "HachiburReview" opens:

var Vaa as INT
var Vab as INT
var Vac as INT
var Vad as INT


If @Update then
{

Vaa = @SelectTreeItem("Search Update Menu!Search Commands!Retrieve New Results (F10)")
Vab = @LoadSortSpec("Hebrew")
Vac = @SelectTreeItem("Search Update Menu!Results Commands!Sort")
Vad = @SelectTreeItem("Search Update Menu!Other Commands!Table View (Shift-F6)")

}

I'm not sure where to place the code.
When the form opens the cursor is not in any element.
  

&&http://www.lantica.com/images/sespro_badges/sespro3.gif&&Paul Anderson&&President&&Systems-Consulting&&89 Main Street, Broad Brook CT 06016&&(860) 627-5393&&Sales@Systems-Consulting.com
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Auto Table View Help
Reply #4 - Nov 23rd, 2005 at 3:27pm
Print Post Print Post  
You may want to split up the code and put some of it in the On Retrieve Open event for the form, and some of it in the On Form Entry event after you have retrieved your values.

On Retrieve Spec Open:
Code
Select All
var Vaa as int

  Vaa = @LoadSortSpec("Hebrew")
  Vaa = @SelectTreeItem("Search Update Menu!Search Commands!Retrieve New Results (F10)")
 



On Form Entry:
Code
Select All
var Vaa as int

  If @Update then
  {
    Vaa = @SelectTreeItem("Search Update Menu!Other Commands!Table View (Shift-F6)")
  }
 

  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
UPaul42
Junior Member
Members
**
Offline


been a Q&A user/programmer
since version 2.0

Posts: 57
Location: Broad Brook CT
Joined: Jul 23rd, 2003
Re: Auto Table View Help
Reply #5 - Nov 28th, 2005 at 11:00pm
Print Post Print Post  
Still fooling with this.

On retrieve Spec Open:
does nothing until you press F10

On Form Entry:
Never opens the table

I copied your example and turned off the macroes I was using.
  

&&http://www.lantica.com/images/sespro_badges/sespro3.gif&&Paul Anderson&&President&&Systems-Consulting&&89 Main Street, Broad Brook CT 06016&&(860) 627-5393&&Sales@Systems-Consulting.com
Back to top
IP Logged
 
UPaul42
Junior Member
Members
**
Offline


been a Q&A user/programmer
since version 2.0

Posts: 57
Location: Broad Brook CT
Joined: Jul 23rd, 2003
Re: Auto Table View Help
Reply #6 - Nov 28th, 2005 at 11:02pm
Print Post Print Post  
The project is currenlty in use by the client with the macros active.
  

&&http://www.lantica.com/images/sespro_badges/sespro3.gif&&Paul Anderson&&President&&Systems-Consulting&&89 Main Street, Broad Brook CT 06016&&(860) 627-5393&&Sales@Systems-Consulting.com
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Auto Table View Help
Reply #7 - Nov 29th, 2005 at 2:19am
Print Post Print Post  
Paul,

Mark had an error in his code. He had the word "Update" included, but it should not be there in the On Retrieve Spec Open event. (It SHOULD be there for the On Form Entry event.)

Replace the corresponding code in the On Retrieve Spec Open event with this:

Code
Select All
@SelectTreeItem("Search Menu!Search Commands!Retrieve New Results (F10)") 



Be careful with the On Form Entry event code. You will get yourself into an endless loop if you use it as is. You will need set some condition to make sure the Table View is only launched once during update mode, or you can simply place it in On Retrieve Spec Open event right under the code that retrieves new results. Something like this:

Code
Select All
var Vaa as int

  Vaa = @LoadSortSpec("Hebrew")
  Vaa = @SelectTreeItem("Search Menu!Search Commands!Retrieve New Results (F10)")
  Vaa = @SelectTreeItem("Search Update Menu!Other Commands!Table View (Shift-F6)") 



Even though the Table View call appears in the On Retrieve Spec Open event, it doesn't actually fire until after the "F10" call, which means it is called when the first record in the result set appears.

This should get you up and running. I just tested it here in version 1.1.2, and it works.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Auto Table View Help
Reply #8 - Nov 29th, 2005 at 2:37am
Print Post Print Post  
Quote:
Mark had an error in his code. He had the word "Update" included, but it should not be there in the On Retrieve Spec Open event. (It SHOULD be there for the On Form Entry event.)


Carl is correct on this (as is the rest of his post).

My mistake. Sorry.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
UPaul42
Junior Member
Members
**
Offline


been a Q&A user/programmer
since version 2.0

Posts: 57
Location: Broad Brook CT
Joined: Jul 23rd, 2003
Re: Auto Table View Help
Reply #9 - Nov 29th, 2005 at 12:42pm
Print Post Print Post  
Thanks to Carl & Mark.

That was the solution.
Grin
  

&&http://www.lantica.com/images/sespro_badges/sespro3.gif&&Paul Anderson&&President&&Systems-Consulting&&89 Main Street, Broad Brook CT 06016&&(860) 627-5393&&Sales@Systems-Consulting.com
Back to top
IP Logged