Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

'At beginning of table' error message 1

Status
Not open for further replies.

Lewy

Technical User
Nov 16, 2001
170
0
16
GB
I have a form which has 2 bound tables. One shown as a detail table frame. On the main form is a field from the detail table which is a period of months followed by another field which is the recall date that has been calculated. To show the correct recall period I have to scroll though the detail table to the last record. However some clients have no records in the detail table frame and hence I get the above message. How can I either bypass the error message or skip to the end of the detail table frame say by tetsing for no record. At present I use the code snippet [detailTable.End()]in the Arrive section of the key field.

thanks,

Lewy
 

Perhaps use a try onfail endtry block around that statement.

Then kill the error message, or pop your own.

try
detailTable.End()
onFail
errorclear()
; msgstop("Error","No detail records")
endTry

Tony McGuire
"It's not about having enough time; we have the rest of our lives. It's about priorities.
 

You could also create and link on a secondary index (on the detail) that causes the detail table to be sorted in reverse, showing most recent at the top. Then there shouldn't be a need to scroll, if I understand correctly.

Tony McGuire
"It's not about having enough time; we have the rest of our lives. It's about priorities.
 
Tony,
Thanks for the help. I like the idea of sorting the detail table in reverse order. I am able to create a secondary index on the table but how do I implememnt it on the form?

Lewy
 


You need to link the tables on that secondary to the main table.

Tony McGuire
"It's not about having enough time; we have the rest of our lives. It's about priorities.
 
The detail table is linked by the client ID. The table frame shows a list of visits to our practice. So how would I show this detail table sorted in most previous visit first? the detail table is keyed on an integer value. Sorry to be awkward but I sometimes get a mental block on these matters!!

Lewy
 

Create a new 2ndary index.

Include the client ID, as well as whatever field will sort by latest visit.

Define that second field sort as Descending.

Then link the detail table on the new secondary index instead of the Client ID alone.

Tony McGuire
"It's not about having enough time; we have the rest of our lives. It's about priorities.
 
Thank you Tony, solution was too simple for my own good! I always seem to look for the most complicated answer...

Have a good weekend, Lewy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top