A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Sorting records in a form



 
 
Thread Tools Display Modes
  #1  
Old September 13th, 2005, 11:42 PM
Jeff S via AccessMonster.com
external usenet poster
 
Posts: n/a
Default 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  
Old September 14th, 2005, 03:08 AM
tina
external usenet poster
 
Posts: n/a
Default

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  
Old September 14th, 2005, 03:26 AM
John Vinson
external usenet poster
 
Posts: n/a
Default

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  
Old September 14th, 2005, 09:04 PM
Jeff S via AccessMonster.com
external usenet poster
 
Posts: n/a
Default

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  
Old September 15th, 2005, 05:12 PM
Jeff S via AccessMonster.com
external usenet poster
 
Posts: n/a
Default

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  
Old September 15th, 2005, 05:19 PM
Jeff S via AccessMonster.com
external usenet poster
 
Posts: n/a
Default

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  
Old September 15th, 2005, 05:39 PM
Jeff S via AccessMonster.com
external usenet poster
 
Posts: n/a
Default

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  
Old September 16th, 2005, 01:03 AM
John Vinson
external usenet poster
 
Posts: n/a
Default

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  
Old September 16th, 2005, 07:20 PM
Jeff S via AccessMonster.com
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 04:22 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.