![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
So, I have a 2-table form, where the child table is presented in a table UIO. I'd like to display only particular records from the child table on the form. (Clearly, only those related to the parent show, but I'd like to restrict it further.) But if I based the table UIO on a query, I don't have a key field to bind the parent to. I considered leaving the parent records off the form and making a filter field where the client could sort by parent, so I could do my own filtering as well when the client entered the parent record, but I really don't want to lose the convenience of navigating the parent records with the next/prev record buttons. Am I pretty much stuck with running the query on form.open (or form.init, i imagine) to a temp table, adding an index to the table, and basing the form's data model on that? (Would that even work? When in the open process does the form check the existence of the tables in the data model?) Or is there a better way to filter records out of a table UIO that I haven't been able to recall yet? |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
I think you are going to have to explain that part better. How can you filter on it if it isn't in the table? What relation does the criteria have to the table you want to restrict? Denn Santoro President Resource Development Associates http://www.RDAWorldWide.Com Offices in the United States and Germany Providing solutions to health care, business, governments and non-profits since 1982 |
#5
| |||
| |||
|
|
So, I have a 2-table form, where the child table is presented in a table UIO. I'd like to display only particular records from the child table on the form. (Clearly, only those related to the parent show, but I'd like to restrict it further.) But if I based the table UIO on a query, I don't have a key field to bind the parent to. I considered leaving the parent records off the form and making a filter field where the client could sort by parent, so I could do my own filtering as well when the client entered the parent record, but I really don't want to lose the convenience of navigating the parent records with the next/prev record buttons. Am I pretty much stuck with running the query on form.open (or form.init, i imagine) to a temp table, adding an index to the table, and basing the form's data model on that? (Would that even work? When in the open process does the form check the existence of the tables in the data model?) Or is there a better way to filter records out of a table UIO that I haven't been able to recall yet? |
#6
| |||
| |||
|
|
I've handled this with a structure like this: MASTER ->> RESULT* -> DETAIL ...where RESULT is a keyed table in PRIV into which the primary key values from the DETAIL table are inserted (by query or code) for those DETAIL records you wish to view. RESULT also needs the MASTER's key: MASTER.ID ->> RESULT.MasterID RESULT.DetailID -> DETAIL.ID RESULT is keyed off both the MasterID and DetailID fields. Hope that makes sense. Liz |
#7
| |||
| |||
|
|
Sure does. That's pretty much what I expected to have to do. I imagine RESULT would just be filled from code in form.init. Obviously the RESULT table has to be around to make the form's data model, but does it actually have to exist before form.init runs? It'd be nice for low-clutter's sake if I could create RESULT on the fly from form.init instead of leaving it there and filling it -- which, of course, is only possible if the data model is checked after init, before open. Any idea? |
#8
| |||
| |||
|
#9
| |||
| |||
|
#10
| |||
| |||
|
|
Guess I should have read yours before I bothered with mine. Pretty much the same solution with only a couple of different details. |
![]() |
| Thread Tools | |
| Display Modes | |
| |