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
|
|||
|
|||
Sorting records in a form
I have a form that captures a lot of information on actions involving
different products. This information is organized in a datasheet subform where each line is an action involving one product. I would like to have a way to capture the same information in a more organized way. For example have tab control where each tab corresponds to a different product but each tab has the same subform that captures the same information. Another solution would be to hide certain records (certain lines) of the subform depending on which button I press on the main form. I think the latter option my be more do-able but I don't know how to implement it. Any help? -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...eries/200509/1 |
#2
|
|||
|
|||
you can't "hide" certain records in the subform, but you don't need to. just
filter the subform's RecordSource for the specific product you want at any given time. you could do that from a combobox control or listbox control on the main form, by listing the products to choose from and using the control's AfterUpdate event to filter the subform, as Me!SubformControlName.Form.Filter = "ProductFieldName = " & Me!ComboboxName Me!SubformControlName.Form.FilterOn = True you have to substitute the correct control and field names, of course. or you could use a tab control with one tab for each product, though this is not a dynamic solution because you would have to create a new tab in the form every time you add a product to your Products table. but it could be done, though the solutions that come to my mind immediately are rather clunky. hth "Jeff S via AccessMonster.com" wrote in message ... I have a form that captures a lot of information on actions involving different products. This information is organized in a datasheet subform where each line is an action involving one product. I would like to have a way to capture the same information in a more organized way. For example have tab control where each tab corresponds to a different product but each tab has the same subform that captures the same information. Another solution would be to hide certain records (certain lines) of the subform depending on which button I press on the main form. I think the latter option my be more do-able but I don't know how to implement it. Any help? -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...eries/200509/1 |
#3
|
|||
|
|||
On Tue, 13 Sep 2005 22:42:23 GMT, "Jeff S via AccessMonster.com"
wrote: I have a form that captures a lot of information on actions involving different products. This information is organized in a datasheet subform where each line is an action involving one product. I would like to have a way to capture the same information in a more organized way. For example have tab control where each tab corresponds to a different product but each tab has the same subform that captures the same information. Another solution would be to hide certain records (certain lines) of the subform depending on which button I press on the main form. I think the latter option my be more do-able but I don't know how to implement it. You might want to filter the subform to show only the records for a selected product at a time. One way to do this would be to have a control - a combo box or listbox perhaps - on the mainform allowing the user to select which product they wish to see; set the Subform's Master Link Field to include this control, and its Child Link Field to include the ProductID. This would have the advantage of not requiring any code. John W. Vinson[MVP] |
#4
|
|||
|
|||
Thanks all for the messages. I am not familiar with writing code and that
helps a lot. Tina, your code works beautifully. Thanks again tina wrote: you can't "hide" certain records in the subform, but you don't need to. just filter the subform's RecordSource for the specific product you want at any given time. you could do that from a combobox control or listbox control on the main form, by listing the products to choose from and using the control's AfterUpdate event to filter the subform, as Me!SubformControlName.Form.Filter = "ProductFieldName = " & Me!ComboboxName Me!SubformControlName.Form.FilterOn = True you have to substitute the correct control and field names, of course. or you could use a tab control with one tab for each product, though this is not a dynamic solution because you would have to create a new tab in the form every time you add a product to your Products table. but it could be done, though the solutions that come to my mind immediately are rather clunky. hth I have a form that captures a lot of information on actions involving different products. This information is organized in a datasheet subform [quoted text clipped - 9 lines] Any help? -- Message posted via http://www.accessmonster.com |
#5
|
|||
|
|||
Actually....
The code in itself works well but when I go to the next record the database locks and I have to close access. Any idea why? Jeff tina wrote: you can't "hide" certain records in the subform, but you don't need to. just filter the subform's RecordSource for the specific product you want at any given time. you could do that from a combobox control or listbox control on the main form, by listing the products to choose from and using the control's AfterUpdate event to filter the subform, as Me!SubformControlName.Form.Filter = "ProductFieldName = " & Me!ComboboxName Me!SubformControlName.Form.FilterOn = True you have to substitute the correct control and field names, of course. or you could use a tab control with one tab for each product, though this is not a dynamic solution because you would have to create a new tab in the form every time you add a product to your Products table. but it could be done, though the solutions that come to my mind immediately are rather clunky. hth I have a form that captures a lot of information on actions involving different products. This information is organized in a datasheet subform [quoted text clipped - 9 lines] Any help? -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...eries/200509/1 |
#6
|
|||
|
|||
I don't understand how to implement this idea:
I put an unbound combo on the main form that allows to select the product. Then how do I "set the Subform's Master Link Field to include this control, and its Child Link Field to include the ProductID". I don't understand this statement. John Vinson wrote: I have a form that captures a lot of information on actions involving different products. This information is organized in a datasheet subform [quoted text clipped - 7 lines] I think the latter option my be more do-able but I don't know how to implement it. You might want to filter the subform to show only the records for a selected product at a time. One way to do this would be to have a control - a combo box or listbox perhaps - on the mainform allowing the user to select which product they wish to see; set the Subform's Master Link Field to include this control, and its Child Link Field to include the ProductID. This would have the advantage of not requiring any code. John W. Vinson[MVP] -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...eries/200509/1 |
#7
|
|||
|
|||
I get there error "You can't carry out this action at the present time" when
I put this code in and then I need shut down the whole database because it locks itself. Help! tina wrote: you can't "hide" certain records in the subform, but you don't need to. just filter the subform's RecordSource for the specific product you want at any given time. you could do that from a combobox control or listbox control on the main form, by listing the products to choose from and using the control's AfterUpdate event to filter the subform, as Me!SubformControlName.Form.Filter = "ProductFieldName = " & Me!ComboboxName Me!SubformControlName.Form.FilterOn = True you have to substitute the correct control and field names, of course. or you could use a tab control with one tab for each product, though this is not a dynamic solution because you would have to create a new tab in the form every time you add a product to your Products table. but it could be done, though the solutions that come to my mind immediately are rather clunky. hth I have a form that captures a lot of information on actions involving different products. This information is organized in a datasheet subform [quoted text clipped - 9 lines] Any help? -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...eries/200509/1 |
#8
|
|||
|
|||
On Thu, 15 Sep 2005 16:19:49 GMT, "Jeff S via AccessMonster.com"
wrote: I don't understand how to implement this idea: I put an unbound combo on the main form that allows to select the product. Then how do I "set the Subform's Master Link Field to include this control, and its Child Link Field to include the ProductID". I don't understand this statement. What are the current Master Link Field and Child Link Field properties? What is the Name property of the combo box? What field within the subform's Recordsource would this combo box be intended to filter? John W. Vinson[MVP] |
#9
|
|||
|
|||
Nevermind John. I managed to do some filtering based on my combo.
Thanks for your help John Vinson wrote: I don't understand how to implement this idea: I put an unbound combo on the main form that allows to select the product. Then how do I "set the Subform's Master Link Field to include this control, and its Child Link Field to include the ProductID". I don't understand this statement. What are the current Master Link Field and Child Link Field properties? What is the Name property of the combo box? What field within the subform's Recordsource would this combo box be intended to filter? John W. Vinson[MVP] -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...eries/200509/1 |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Tell if Form is a Dialog | Alex | Using Forms | 7 | August 30th, 2005 06:22 PM |
ECHO Causing Problems | DS | General Discussion | 5 | May 17th, 2005 02:19 AM |
strategy for data entry in multiple tables | LAF | Using Forms | 18 | April 25th, 2005 04:04 AM |
Requerying a pop up form to display in the main form | Jennifer P | Using Forms | 13 | April 5th, 2005 06:59 PM |
Need query to separate 2 entry types in a table field | Jan Il | Running & Setting Up Queries | 31 | November 23rd, 2004 05:57 PM |