Creating a sub form that displays data subject to lots of combo bo

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am creating a database where I have to create a sub form that displays
data in a tabular form consisting of up to 18 column and over a thousand
rows. The data that I want to display is at the moment only dependent only on
one of these combo selections. How should I best change this in order that it
the data will use each combo selction as a filter??

Cheeers
 
You can reference the combo in the Record Source of the SubForm.

Select * From TableName Where FieldName = Forms![FormName]![ComboName]

On the AfterUpdate event of the combo run the code to refresh the data in
the sub form

Me.[SubFormName].Requery
 
Ofer said:
You can reference the combo in the Record Source of the SubForm.

Select * From TableName Where FieldName = Forms![FormName]![ComboName]

On the AfterUpdate event of the combo run the code to refresh the data in
the sub form

Me.[SubFormName].Requery

--
\\// Live Long and Prosper \\//
BS"D


Eamonn said:
Hi,

I am creating a database where I have to create a sub form that displays
data in a tabular form consisting of up to 18 column and over a thousand
rows. The data that I want to display is at the moment only dependent only on
one of these combo selections. How should I best change this in order that it
the data will use each combo selction as a filter??

Cheeers
 
Sorry that didnt seem to come up correctly! I tried what you reccomended and
it told me I had a sytax error in the VBA editor when I tried to compile-
Seems to be an issue with the * after select??? not sure

Thanks a million for gettin back so quick
-Eamonn

Ofer said:
You can reference the combo in the Record Source of the SubForm.

Select * From TableName Where FieldName = Forms![FormName]![ComboName]

On the AfterUpdate event of the combo run the code to refresh the data in
the sub form

Me.[SubFormName].Requery

--
\\// Live Long and Prosper \\//
BS"D


Eamonn said:
Hi,

I am creating a database where I have to create a sub form that displays
data in a tabular form consisting of up to 18 column and over a thousand
rows. The data that I want to display is at the moment only dependent only on
one of these combo selections. How should I best change this in order that it
the data will use each combo selction as a filter??

Cheeers
 
I do not have a "Record source" in my subforms but I have
a "Source Object". Is those two things the same ?
 
You are looking at the properties of the wrong thing.

The subform *control* has a SourceObject property, i.e. the name of the form
to be loaded into it.

The form in the subform control has a RecordSource property, i.e. the table,
query or SQL statement that defines what records are to be shown.
 
I'm a bit confused to be honest - I'm new to access.

I'm allmost sure that I look at my subforms propperty.

I can only find the Source Object property in my subform, containing
the name
of a query. As I understand you, then a subform should not have a
Record source
but a SourceObject.....I hope.

I'm not sure about what you mean by "The form in the subform..."

English is not my native language, so sometimes I get a little confused
:)



www.photo.activewebsite.dk
 
When you look at a form in design view, you can right-click on a text box,
and choose Properties. The title of the Properties dialog includes "Text
Box" to tell you what you are looking at. You can also look at the
properties of a line, a label, a combo, or of the form itself.

The form can also have a subform control. It is a special control that
Access uses to load another form into. When you look at its properites, the
title bar of the Properties box reads "Subform/subreport". So how does
Access know which form is supposed to be loaded into this control? The
Source Object property indicates that.

If you click the subform again, you are now looking at the properties of the
form *in* the subform control. These are the same properties as if you chose
the form in the Database window, and opened it directly there instead of
through the main form.

The important concept is that the form itself has different properties than
the subform control does.

BTW, the English in your posts is very good if it is not the language you
think in.
 
The form can also have a subform control. It is a special control that
Access uses to load another form into. When you look at its properites, the
title bar of the Properties box reads "Subform/subreport". So how does
Access know which form is supposed to be loaded into this control? The
Source Object property indicates that.

I did not think of a subform as a control, and that it was Source
Object that decided what was put into it. I made my form+subform
using the wizard, and by doing it this way you don't learn all these
details, that is so important to the understanding of how it all is
connected

What confused me, and still do, was the first post in this threat where
Ofer wrote "You can reference the combo in the Record Source of the
SubForm". When I read this line, I understand it as I must find the
Record Source in the Subform-property...but I must understand this
wrong.
BTW, the English in your posts is very good if it is not the language you
think in.

Thanks :) I'm using my Danish to English book alot when posting here.
 
Eamonn said:
Sorry that didnt seem to come up correctly! I tried what you reccomended and
it told me I had a sytax error in the VBA editor when I tried to compile-
Seems to be an issue with the * after select??? not sure

Thanks a million for gettin back so quick
-Eamonn

Ofer said:
You can reference the combo in the Record Source of the SubForm.

Select * From TableName Where FieldName = Forms![FormName]![ComboName]

On the AfterUpdate event of the combo run the code to refresh the data in
the sub form

Me.[SubFormName].Requery

--
\\// Live Long and Prosper \\//
BS"D


Eamonn said:
Hi,

I am creating a database where I have to create a sub form that displays
data in a tabular form consisting of up to 18 column and over a thousand
rows. The data that I want to display is at the moment only dependent only on
one of these combo selections. How should I best change this in order that it
the data will use each combo selction as a filter??

Cheeers
 
Can you post the code where you get the error?

--
\\// Live Long and Prosper \\//
BS"D


Eamonn said:
Eamonn said:
Sorry that didnt seem to come up correctly! I tried what you reccomended and
it told me I had a sytax error in the VBA editor when I tried to compile-
Seems to be an issue with the * after select??? not sure

Thanks a million for gettin back so quick
-Eamonn

Ofer said:
You can reference the combo in the Record Source of the SubForm.

Select * From TableName Where FieldName = Forms![FormName]![ComboName]

On the AfterUpdate event of the combo run the code to refresh the data in
the sub form

Me.[SubFormName].Requery

--
\\// Live Long and Prosper \\//
BS"D


:

Hi,

I am creating a database where I have to create a sub form that displays
data in a tabular form consisting of up to 18 column and over a thousand
rows. The data that I want to display is at the moment only dependent only on
one of these combo selections. How should I best change this in order that it
the data will use each combo selction as a filter??

Cheeers
 
Hi,

Okay first of all to enter the properties of the subform - I clicked on the
top left hand corner of the subform as opposed to the interior of the sub
form if you get me. I assume thats okay

Under record source I entered Select*[Sheet1] where DEAL TYPE =
forms![formq]![Combo40]

and under AfterUpdate I entered Me.[Sheet1 subform3].Requery


when I try and open the form in form view I am told the record source I
entered on the form does not exist


Many thanks
Eamonn

Ofer said:
Can you post the code where you get the error?

--
\\// Live Long and Prosper \\//
BS"D


Eamonn said:
Eamonn said:
Sorry that didnt seem to come up correctly! I tried what you reccomended and
it told me I had a sytax error in the VBA editor when I tried to compile-
Seems to be an issue with the * after select??? not sure

Thanks a million for gettin back so quick
-Eamonn

:

You can reference the combo in the Record Source of the SubForm.

Select * From TableName Where FieldName = Forms![FormName]![ComboName]

On the AfterUpdate event of the combo run the code to refresh the data in
the sub form

Me.[SubFormName].Requery

--
\\// Live Long and Prosper \\//
BS"D


:

Hi,

I am creating a database where I have to create a sub form that displays
data in a tabular form consisting of up to 18 column and over a thousand
rows. The data that I want to display is at the moment only dependent only on
one of these combo selections. How should I best change this in order that it
the data will use each combo selction as a filter??

Cheeers
 
Back
Top