If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Customize form based on query results
I am looking to make a form that is auto customized for each record.
For exampe. If i have 25 possible items. Record 1 might have 14 and 22 and Record 2 might have 1, 2, 10, 15,16,21 and 25. I want to make a form that will list the items in order for each record, without leaving gaps- so using the if true then visible wont work, because for example record 1 will only have 2 out of 25 while record 2 contains 7. and there would be all the gaps between 1 and 25 that are not visible. I had originally planned to use visible headers and place each item in a header, if item = true, then header is visible. but i cannot figure out how to add multiple headers to a form (like i can in a report). Any help on creating this form would be helpful! thanks! |
#2
|
|||
|
|||
Customize form based on query results
A couple of solutions come to mind, but neither is prettty. The simplest
approach would be to use a main form and include on it all the attributes of the various items that are common to all items. Then, create a separate sub form for each type of item. The other, which would require fairly extenisve VBA coding, would be to create one form. The form would have controls bound to all the fields in a record. These controls, however, would be invisible. Then you would have an equal number of unbound controls which would also all be invisible to start with. Then to display the data you would have to make as many of the controls visible as you need for the item. Once the user has entered data in an unbound visible control, you would then have to assign the entered value to the appropriate bound control. As you can see, either of these are going to be messy. "Vince" wrote: I am looking to make a form that is auto customized for each record. For exampe. If i have 25 possible items. Record 1 might have 14 and 22 and Record 2 might have 1, 2, 10, 15,16,21 and 25. I want to make a form that will list the items in order for each record, without leaving gaps- so using the if true then visible wont work, because for example record 1 will only have 2 out of 25 while record 2 contains 7. and there would be all the gaps between 1 and 25 that are not visible. I had originally planned to use visible headers and place each item in a header, if item = true, then header is visible. but i cannot figure out how to add multiple headers to a form (like i can in a report). Any help on creating this form would be helpful! thanks! |
#3
|
|||
|
|||
Customize form based on query results
The problem is that your table is not normalized. You can do what you are
asking but only with a lot of code and the use of an unbound form (you can bind the controls at runtime by changing their ControlSource). If you normalize the data, you can use a subform and NO code. I don't know what the 25 things are, but rather than having one row with 25 instances of the same item, some of which may be null, you need to add a second table. It will contain 0-25 rows. One for each of the 25 instances which is populated. The subform will show only records that exist. "Vince" wrote in message ... I am looking to make a form that is auto customized for each record. For exampe. If i have 25 possible items. Record 1 might have 14 and 22 and Record 2 might have 1, 2, 10, 15,16,21 and 25. I want to make a form that will list the items in order for each record, without leaving gaps- so using the if true then visible wont work, because for example record 1 will only have 2 out of 25 while record 2 contains 7. and there would be all the gaps between 1 and 25 that are not visible. I had originally planned to use visible headers and place each item in a header, if item = true, then header is visible. but i cannot figure out how to add multiple headers to a form (like i can in a report). Any help on creating this form would be helpful! thanks! |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Need Help In Printing Current Record in Specific Report | RNUSZ@OKDPS | Setting Up & Running Reports | 1 | May 16th, 2005 09:06 PM |
Design help, please | SillySally | Using Forms | 27 | March 6th, 2005 04:11 AM |
Big number gives error! | Sara Mellen | Running & Setting Up Queries | 8 | October 11th, 2004 02:48 AM |
Display Parameter from Form on Report | sara | Setting Up & Running Reports | 10 | July 19th, 2004 04:54 PM |
surely a form with a ListBox can be used in a query? | 1.156 | Running & Setting Up Queries | 14 | June 2nd, 2004 04:54 PM |