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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I reliably use 2 tables on one form???

Status
Not open for further replies.

SonOfTed

Programmer
Mar 30, 2005
25
US
Has anyone ever experimented with TWO updateable tables on one form?

1. Basically I start out with a primary table listing clients I work with.

2. Then I linked it (one-to-many) to a table of medications prescribed for each client:

Clients.DB <-------------->> Medications.DB

One client is displayed at a time on the top section of the screen. On the lower portion is a table listing all medications related to the client (by his/her Client ID). It works great, using F9 allows the information I both tables to be updated. I click in the top section of the form and use the arrow keys to move between clients, and the bottom part of the screen auto-adjusts to list his medications.

Example A: Joe Smith has 3 prescriptions to take:
Aspirin
An antibiotic, and
An arthritic ointment.

Therefore Joe has one row in the Client table and three rows in the Medications table. I can use the bottom section to add new medication rows, delete old ones, or update the existing ones.

3. I wanted to take this one step further and allow users the option of scheduling when the medications are to be taken. Basically I created a third table:

Clients.DB <--->> Medications.DB <--->> Med_Schedule.DB

I changed the bottom of the form to hold both the medication and schedule tables. The table on the left still lists the 3 medications assigned to Joe, but I added a new table (Med Schedule) on the right.

Example B:

a. With Joe’s Client entry displayed at top, I click on the Aspirin row in Table 1 to make it current.
b. Then I click in the Schedule table (on the right) and enter two rows for aspirin, since it should be taken at 11 AM and 4:30 p.m.
c. Next I click on the second med, the Antibiotic in Table 1.
d. Table 2 goes blank because it currently contains no rows.
e. I add 4 entries for this med, to be taken at 9:00 a.m., 1:00 p.m., and 5:00 p.m., and 9:00 p.m.
f. The Arthritic ointment (med 3) I add NO schedule entries for because it should be used as needed.
g. However, I can still move between clients by clicking on the top part of the screen OR view each schedule for either of the first two meds by clicking on it in the left table. The right table finds the rows matching the medications key and displays the schedule rows.


This process DOES work but has intermittent errors. Every once in a while when I click on one of the medications, Paradox becomes confused and locks up. I have to exit out and restart.

One of the remedies I tried for this was to make the Clients.DB table Read-Only. You can still view the client at the top of the screen and use the entry to list the matching medication entries below, but another form must be used if you need to change the client information.

I am wondering if this is just asking TOO much of Paradox. So far I have been unable to get the two-table process to work.
 
As to the confusion, I'm going to guess that you have code working behind the scenes, and it is firing multiple (endless?) times.

I've seen Paradox forms with over a dozen tables on a single form.

It's all in the relationships set up, the code used trapping events, and where the code is placed.

Tony McGuire
"It's not about having enough time. It's about priorities.
 
I've been able to get MANY tables in one data model before also (and thereby onto the form). However, most of the support tables are included as read-only lookups and are NOT updateable. It's only when I try to use two updateable table frames that I have this difficulty.

To keep things simple, I use no ObjectPal code, and THAT may be the problem. I simply set up the data model within the form, and create two tables on it, one or each of the "one-to-many" tables as described above.

It's just something I've tried from time to time, and would like to be able to have work with the generated code only. I guess I'm expecting too much of the defaults -- I'm the one who's declining to dig in and do the coding.

Thanks Tony!!
Todd
 
There shouldn't be anything in the default behaviour that would cause what you are describing.

You should be able to set it up so you can edit many different tables on a single form, particularly without code; it is more like that custom code might cause what you describe than default Paradox behaviour.

What version of Paradox are you using?

Single workstation, or shared data?

If shared, is 'Local Share = True' set in the BDE Administrator?

If shared, what OS on the workstation(s) and what OS on the server?



Tony McGuire
"It's not about having enough time. It's about priorities.
 
Q: What version of Paradox are you using?
A: Version 11.

Q: Single workstation, or shared data?
A: Shared on a network drive.

Q: If shared, is 'Local Share = True' set in the BDE Administrator?
A: Mine was set to “False” ... will try it with “True” for awhile.

Q: If shared, what OS on the workstation(s) and what OS on the server?
A: Windows XP Professional on the workstation and Windows Server for the network.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top