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 » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Content of subform to display according to main form



 
 
Thread Tools Display Modes
  #1  
Old April 11th, 2008, 09:48 AM posted to microsoft.public.access.forms
Johanna Gronlund
external usenet poster
 
Posts: 49
Default Content of subform to display according to main form

Hello,

I have a basic question about forms (I hope).

I have companies, each providing several different services. I need a form
where data entry clerk can first choose the company from a drop down list and
then all the services that they provide are displayed below (I think I need
to create a subform?). Can anyone give me guidance on how this might be
achieved? Ideally without using code as I am not experienced in this. I have
tried wizards and books but have been unable to do this.

Thanks,

Johanna

  #2  
Old April 11th, 2008, 01:27 PM posted to microsoft.public.access.forms
Golfinray
external usenet poster
 
Posts: 1,597
Default Content of subform to display according to main form

You need an unbound combo box to act as a filter. Build your form with all
the data then probably the best solution is to build a tables with just the
company name. Make the table of company names the basis of the combo box.
Have the company names in the form also, but hidden. Go into the properties
of the combo and in events use the after update event (the box at the end of
the line.) Start code builder and type:
Me.filter = "[company name] = """ & me.thenameofyourcombobox & """"
Me.filteron = True
Another option would be to build a form with company name and subform with
company data.

"Johanna Gronlund" wrote:

Hello,

I have a basic question about forms (I hope).

I have companies, each providing several different services. I need a form
where data entry clerk can first choose the company from a drop down list and
then all the services that they provide are displayed below (I think I need
to create a subform?). Can anyone give me guidance on how this might be
achieved? Ideally without using code as I am not experienced in this. I have
tried wizards and books but have been unable to do this.

Thanks,

Johanna

  #3  
Old April 11th, 2008, 02:10 PM posted to microsoft.public.access.forms
LLFK
external usenet poster
 
Posts: 3
Default Content of subform to display according to main form

1. Build a table with two fields. One column is the company name and the
other are the services that company provides.

2. Add all the appropriate records to your table.
Ex. Record 1 = Microsoft (company name), Computer Training (service)
Record 2 = Microsoft, Computer Purchases
Record 3 = Yahoo, Online Shopping
Record 3 = Potterybarn, Kids Clothing

3. Create a combo box on your form with the source being the above table so
the user can pick the company.

4. Create a second combo box that links to a new query that uses your
created table as the source. Include both fields. In the criteria line
under the field for company, put in [Forms]![name of your form]![combo box
field name corresponding to the one where you have your user select the
company name]

Now your drop down on your form will only be limited to the services the
company (who your user selected) provides.

"Johanna Gronlund" wrote:

Hello,

I have a basic question about forms (I hope).

I have companies, each providing several different services. I need a form
where data entry clerk can first choose the company from a drop down list and
then all the services that they provide are displayed below (I think I need
to create a subform?). Can anyone give me guidance on how this might be
achieved? Ideally without using code as I am not experienced in this. I have
tried wizards and books but have been unable to do this.

Thanks,

Johanna

  #4  
Old April 11th, 2008, 02:56 PM posted to microsoft.public.access.forms
Johanna Gronlund
external usenet poster
 
Posts: 49
Default Content of subform to display according to main form

Thanks for your reply. I managed to do the combo box with all the companies.
My only problem is that the services section only displays one service per
company and I have to use the arrow on the bottom of the screen to flick from
one service to another. How can I show all the services for one company once?
Or is this even possible?



"Golfinray" wrote:

You need an unbound combo box to act as a filter. Build your form with all
the data then probably the best solution is to build a tables with just the
company name. Make the table of company names the basis of the combo box.
Have the company names in the form also, but hidden. Go into the properties
of the combo and in events use the after update event (the box at the end of
the line.) Start code builder and type:
Me.filter = "[company name] = """ & me.thenameofyourcombobox & """"
Me.filteron = True
Another option would be to build a form with company name and subform with
company data.

"Johanna Gronlund" wrote:

Hello,

I have a basic question about forms (I hope).

I have companies, each providing several different services. I need a form
where data entry clerk can first choose the company from a drop down list and
then all the services that they provide are displayed below (I think I need
to create a subform?). Can anyone give me guidance on how this might be
achieved? Ideally without using code as I am not experienced in this. I have
tried wizards and books but have been unable to do this.

Thanks,

Johanna

 




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


All times are GMT +1. The time now is 01:51 AM.


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