Page Index Toggle Pages: 1 [2] 3 4  Send Topic Send Topic Print Print
Very Hot Topic (More than 25 Replies) Table question. (Read 7359 times)
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1350
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Table question.
Reply #15 - Jun 19th, 2007 at 3:31am
Print Post Print Post  
drastixnz wrote on Jun 18th, 2007 at 7:47pm:
you mean something like this? Record # /= @GlobalValue("Record #")

No. I mean that you should simply enter "/=" (without the quotes) into the primary key field on the parent form.

A forward slash, followed by an equal sign, stands for "not empty". Earlier, you wrote that you wanted all of the records to show in the subform, and "/=" will show all the records where the subrecord's key field is not empty.

Actually, I made an error. I was thinking of all records that had a value in the key field. But, if you really want ALL the records to show in the subform, you would be better to enter "=;/=" (without the quotes) in the parent record's key field. This would tell Sesame to populate the subform with all records where the key field is "empty" OR "not empty", effectively getting every last subrecord to show in the subform table.

EDIT: I had the restrict specs reversed like this "/=;=", but I corrected it to "=;/=".
« Last Edit: Jun 20th, 2007 at 1:15am by Carl Underwood »  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
drastixnz
Full Member
***
Offline


A Newbie....

Posts: 146
Location: New Zealand
Joined: Nov 29th, 2006
Re: Table question.
Reply #16 - Jun 19th, 2007 at 7:21am
Print Post Print Post  
"primary key field " is there any way that I need to set the field up to be the primary key field?
  
Back to top
IP Logged
 
SirKitry
Member
*
Offline


No personal text

Posts: 13
Joined: Jul 2nd, 2005
Re: Table question.
Reply #17 - Jun 19th, 2007 at 8:52am
Print Post Print Post  
In actual fact, "ALL" _is_ a bit excessive when you consider the potential number of records available in a well used database.
We will have a pull-down that limits records by current month, 2 months, 6 months and 12 months.
The default will be '2 months' and can be extended or reduced as necessary.
(After 12 months the jobs that this system is keeping a track of are archived to a separate directory anyway)
  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1350
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Table question.
Reply #18 - Jun 19th, 2007 at 12:03pm
Print Post Print Post  
drastixnz wrote on Jun 19th, 2007 at 7:21am:
"primary key field " is there any way that I need to set the field up to be the primary key field?

Based on your previous post where you wrote "I have created a subform that is relationally linked and I used a common field which is record number", it sounds like you have already set it up. It's something that is done when you first create the subform in Designer. If you built it as a relational subform, you were required to specify the "Parent Record Field" in the Subform Settings dialogue box. You can view it now by opening the parent form in Designer, right-clicking on the subform and selecting "Subform Settings" from the mini popup menu.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1350
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Table question.
Reply #19 - Jun 19th, 2007 at 12:13pm
Print Post Print Post  
SirKitry wrote on Jun 19th, 2007 at 8:52am:
In actual fact, "ALL" _is_ a bit excessive...

Well that wasn't my idea, Paul said he wanted to display all records. I was letting him know how to do what he asked. Wink

Quote:
We will have a pull-down that limits records by current month, 2 months, 6 months and 12 months.

Might that be the reason he wasn't seeing all the records? Smiley

An easy way to see only the most recent records in the subform, is to set up a default sort for the subform, sorted by descending date.

BTW, what method are you using to limit the subform to only show a limited number of relationally linked records. If you are using the record number as the key, it should be showing all the matching records, regardless of the date.

When Paul wrote "I see records there but I want to display all records", it sounded to me like he was seeing all the records that matched the key (record number), but that he wanted to see all the records that were in the database. That's what lead to the suggestion to use "/=;=" in the parent's key field. But, now I'm not sure that this is what you guys are asking for. You'll need to clarify exactly which records you are wanting to display in the subform.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
drastixnz
Full Member
***
Offline


A Newbie....

Posts: 146
Location: New Zealand
Joined: Nov 29th, 2006
Re: Table question.
Reply #20 - Jun 19th, 2007 at 8:01pm
Print Post Print Post  
Hello Carl,
I am sorry for the muck up, this is what I want.


I have a form called "Plan Track V0.2" within that form is a subform (Plan Tracking Log) which contains a table called "Plan Tracking Log".

I do enter the data into "Plan Tracking Log" via the Subform I enter it in at a different place, in the program.

When I open the form "Plan Track V0.2" I want the subfrom to show all of the data, that has been entered.

I am sorry for the misunderstading

Paul D
  
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Table question.
Reply #21 - Jun 19th, 2007 at 8:50pm
Print Post Print Post  
Let me try to muck this up even more.

Am I understanding you correctly when I say you have an application with 2 databases.

1 database is called "Plan Track V0.2”
1 database is called  Plan Tracking Log

On the form of Plan Track V0.2 you have a subform that is made of  the Plan Tracking Log.

If this interpretation is correct there is 2 methods to use this.

One method is you open your application go to Plan Tracking Log database and enter or update records.
You then leave that database and open "Plan Track V0.2”

When you go to a specific record you want the records associated with it that is in Plan Tracking Log to display in the subform.

This first method would use a relational link

The other method is
You open your application and it takes you to  "Plan Track V0. You either enter a new record or search to find an existing record. Once on the specific record, you enter data into a subform created of the Plan Tracking Log database.

Every time you return to the specific record in "Plan Track V0 it displays the associated data in Plan Tracking Log subform.

This second method would use a natural link (or a relational link with some sbasic programming)

Both of these are easy to create. If you can tell us what method as explained above you are attempting to use, we can help you reach your goal.

I hope I am on the right track this time  Smiley

Robert
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
SirKitry
Member
*
Offline


No personal text

Posts: 13
Joined: Jul 2nd, 2005
Re: Table question.
Reply #22 - Jun 19th, 2007 at 8:54pm
Print Post Print Post  
Carl Underwood quoted : Quote:
Might that be the reason he wasn't seeing all the records? Smiley


Paul hasn't coded for the restriction by months yet. He's working on just seeing the table filled up first, then will code for limiting whats seen Smiley
  
Back to top
 
IP Logged
 
drastixnz
Full Member
***
Offline


A Newbie....

Posts: 146
Location: New Zealand
Joined: Nov 29th, 2006
Re: Table question.
Reply #23 - Jun 19th, 2007 at 9:17pm
Print Post Print Post  
1 database is called "Plan Track V0.2”
1 database is called  Plan Tracking Log
* drastixnz Yes I have

On the form of Plan Track V0.2 you have a subform that is made of  the Plan Tracking Log.
/me Yes I have


One method is you open your application go to Plan Tracking Log database and enter or update records.
You then leave that database and open "Plan Track V0.2”
/me This is the way I am wanting to do it

When you go to a specific record you want the records associated with it that is in Plan Tracking Log to display in the subform.
/me No I want all of the records displayed in the subform, when i click on the record in the subform, it will display in the "Plan Track V0.2" form

I hope this is clearer, Thanks once again drastixnz
  
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Table question.
Reply #24 - Jun 19th, 2007 at 9:42pm
Print Post Print Post  
drastixnz wrote on Jun 19th, 2007 at 9:17pm:
* drastixnz No I want all of the records displayed in the subform, when i click on the record in the subform, it will display in the "Plan Track V0.2" form

[color=#ff0000][/color]


OK I believe you are saying you want every record to show from Plan Tracking Log in the subform no matter what record is showing in “Plan Track V0.2”

There is probably better and smarter ways to do this, I am sure the Lanticans or others will also chime in, but this should work for you.

Ad an element to Plan Tracking Log  named something like logKey.  Use logic to fill it with an X whenever a record is created. (one time mass updatate all existing records to have an X in this element)

Now

Ad an element to “Plan Track V0.2”    named PlanTracklogKey.  Use logic to fill it with an X whenever a record is created. (one time mass updatate all existing records to have an X in this element)

Open  “Plan Track V0.2”  and create a subform selecting Plan Tracking Log for the subform and select element PlanTracklogKey for parent record field and select logKey for child record field.

Now whenever you work with a record in “Plan Track V0.2” a match of the records will be found with every record in Plan Tracking Log and they will appear in your table view subform.

If you need any assistance in creating, updating or logic to fill the keys in the records let us know.

With Sesame there is always many ways to accomplish a task, this is just one method. I am not sure it’s a great method but until others chime in, it is an option.
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
drastixnz
Full Member
***
Offline


A Newbie....

Posts: 146
Location: New Zealand
Joined: Nov 29th, 2006
Re: Table question.
Reply #25 - Jun 21st, 2007 at 1:33am
Print Post Print Post  
Yes i will need help with the code for this.
  
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Table question.
Reply #26 - Jun 21st, 2007 at 4:53am
Print Post Print Post  
To mass update existing records open the Plan Track V0.2”  Database in search / update mode with the command tree open. (Open the actual application not Sdesigner)

Press f7 f10 to select all the records

On the left hand side of screen on the bottom half of the command tree (I think it opens in default as sort) click the third arrow until it is on Mass update property.

click on PlanTracklogKey (or any element it really does not matter) to open the mass update editor.

Enter:  
PlanTracklogKey = “X”
Click on test to check logic
Exit editor

Click on the first down arrow and select run.
Select continue to have it all run or select interactive to do 1 at a time

Do the same thing for Plan Tracking log database using element log key.

This now set both key fields in all the records to be X

Your relational table subform will now work if it is set up correctly.

Now open Sdesigner to make all future record key elements  be x you will need to put logic like (example below) in both databases. (just switch PlanTracklogKey with log key)

If Not @isblank(your element name that proves you want to save this record goes here)

Then
     {
     PlanTracklogKey = “x”
     }


Hope this is somewhat clear. Let me know if I lost you somewhere.

Robert
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1350
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Table question.
Reply #27 - Jun 21st, 2007 at 12:22pm
Print Post Print Post  
Bob,

They could avoid the need for another field in the child form, by building the subform to link the parent key to any field in the child, then mass updating the parent key field with "=;/=". This will retrieve all records in the subform. Sesame understands retrieve specs in a parent key field. You could event use wildcards in the key field, such as "B..".

What's really neat, is that you can even link a text field in the parent, to a date field in the child. This gives you the ability to use stuff like: "2007/02/01..2007/04/30", "2007/01/01..", or ">2007/05/31" in the parent key. That produces a table of subrecords within that date range. The only catch is that the rertrieve criteria in the key must be in the format that Sesame stores dates in on the disk (YYYY/MM/DD format).
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Table question.
Reply #28 - Jun 21st, 2007 at 12:59pm
Print Post Print Post  
Quote:
Sesame understands retrieve specs in a parent key field.


Just wanted to expand a little bit on what Carl said. Yes, Sesame does understand retrieve specs in the Parent key but the full family of retrieve spec options is not available to the Relational Link, i.e. functions like Min and Max will not work. The Relational Link does understand everything that is valid to put into a restriction spec. So if you just think of the Parent Key as a restriction spec as to what children it can display, you're gonna be on the right track. Restrictions are covered on pages 120-122 of the Sesame 1.1 User Guide in case anyone needs a reference.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Table question.
Reply #29 - Jun 21st, 2007 at 1:51pm
Print Post Print Post  
Thanks Carl & Ray for the good info. As I keep learning, there are always lots of ways to accomplish a task with Sesame!

I really think that after Drastixnz plays with Sesame and Sdesigner for a while he will find better ways to accomplish his goals. I figured keep all the steps in this first relational subform as clean and vanilla as possible so it is easy to see what’s going on under the hood.

The few things I am sure of is that Sesame can do what Drastixnz needs and wants and that people here on the forum will help and guide as much as he needs.

Keep us posted Drastixnz, we are all learning with you.  Smiley
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 3 4 
Send Topic Send Topic Print Print