Listbox controlling Sub-form

I have a listbox that is populated from a sub query (qyListFEA). I have set 
the subform's LinkMasterField and LinkChildField to this listbox.

The list box contains 3 columns (Project Name, Project Number and Iteration). 

When I select let's say Wheel 1, 5214, 1C, the subform only shows the Wheel 
1 at iteration 1.

How can I get the data to synchronize so that if I select Wheel 1 at 
iteration 1c or 2, etc. I can get the correct record to show?

Note: the sub query "qyListFEA" is based upon "qyFEA" which is where I need 
the actual data from.  If I use the master query in the listbox, I get a 
bunch of ID's instead of the text.

Any help would be appreciated.


0
Utf
1/14/2008 5:04:02 PM
access.forms 6864 articles. 2 followers. Follow

13 Replies
1385 Views

Similar Articles

[PageSpeed] 58

You don't use form controls in the link master and link child properties of 
the subform control.  Use the names of fields in the form and subform 
recordsets.
-- 
Dave Hargis, Microsoft Access MVP


"John Petty" wrote:

> I have a listbox that is populated from a sub query (qyListFEA). I have set 
> the subform's LinkMasterField and LinkChildField to this listbox.
> 
> The list box contains 3 columns (Project Name, Project Number and Iteration). 
> 
> When I select let's say Wheel 1, 5214, 1C, the subform only shows the Wheel 
> 1 at iteration 1.
> 
> How can I get the data to synchronize so that if I select Wheel 1 at 
> iteration 1c or 2, etc. I can get the correct record to show?
> 
> Note: the sub query "qyListFEA" is based upon "qyFEA" which is where I need 
> the actual data from.  If I use the master query in the listbox, I get a 
> bunch of ID's instead of the text.
> 
> Any help would be appreciated.
> 
> 
0
Utf
1/14/2008 5:35:00 PM
Dave, 

Thanks for the response.  I would have responded sooner but I had a calculus 
class to attend.

That being said, I tried to set the master and child field links to tje 
field names but to no avail.  I get input boxes asking for the field 
criteria, or when I link all fields in the listbox, I get an error stating 
that I must have the same number of fields defined on both the Master and 
Child link fields (and I do and in the same order).

I did forget to mention that I have the listbox on on tab control and the 
subform on another. Could this be the problem? If so, how can I define the 
code to link them together?


"Klatuu" wrote:

> You don't use form controls in the link master and link child properties of 
> the subform control.  Use the names of fields in the form and subform 
> recordsets.
> -- 
> Dave Hargis, Microsoft Access MVP
> 
> 
> "John Petty" wrote:
> 
> > I have a listbox that is populated from a sub query (qyListFEA). I have set 
> > the subform's LinkMasterField and LinkChildField to this listbox.
> > 
> > The list box contains 3 columns (Project Name, Project Number and Iteration). 
> > 
> > When I select let's say Wheel 1, 5214, 1C, the subform only shows the Wheel 
> > 1 at iteration 1.
> > 
> > How can I get the data to synchronize so that if I select Wheel 1 at 
> > iteration 1c or 2, etc. I can get the correct record to show?
> > 
> > Note: the sub query "qyListFEA" is based upon "qyFEA" which is where I need 
> > the actual data from.  If I use the master query in the listbox, I get a 
> > bunch of ID's instead of the text.
> > 
> > Any help would be appreciated.
> > 
> > 
0
Utf
1/14/2008 9:06:01 PM
In short, I am trying to use the listbox to filter the data.  If possible, I 
am wanting to use this method throughout my app.

"John Petty" wrote:

> Dave, 
> 
> Thanks for the response.  I would have responded sooner but I had a calculus 
> class to attend.
> 
> That being said, I tried to set the master and child field links to tje 
> field names but to no avail.  I get input boxes asking for the field 
> criteria, or when I link all fields in the listbox, I get an error stating 
> that I must have the same number of fields defined on both the Master and 
> Child link fields (and I do and in the same order).
> 
> I did forget to mention that I have the listbox on on tab control and the 
> subform on another. Could this be the problem? If so, how can I define the 
> code to link them together?
> 
> 
> "Klatuu" wrote:
> 
> > You don't use form controls in the link master and link child properties of 
> > the subform control.  Use the names of fields in the form and subform 
> > recordsets.
> > -- 
> > Dave Hargis, Microsoft Access MVP
> > 
> > 
> > "John Petty" wrote:
> > 
> > > I have a listbox that is populated from a sub query (qyListFEA). I have set 
> > > the subform's LinkMasterField and LinkChildField to this listbox.
> > > 
> > > The list box contains 3 columns (Project Name, Project Number and Iteration). 
> > > 
> > > When I select let's say Wheel 1, 5214, 1C, the subform only shows the Wheel 
> > > 1 at iteration 1.
> > > 
> > > How can I get the data to synchronize so that if I select Wheel 1 at 
> > > iteration 1c or 2, etc. I can get the correct record to show?
> > > 
> > > Note: the sub query "qyListFEA" is based upon "qyFEA" which is where I need 
> > > the actual data from.  If I use the master query in the listbox, I get a 
> > > bunch of ID's instead of the text.
> > > 
> > > Any help would be appreciated.
> > > 
> > > 
0
Utf
1/14/2008 9:14:00 PM
As I said before, you have to link the data in the subform to the data in the 
master form using the fields in the tables.  There is no way to link using 
any kind of control.

You could filter the data, but depending how may rows are in your list box, 
it may cause the form to appear slow.

Is this a multi select list box?  If so, I can send you a function that will 
return a string you can use for filtering (note, I have not used it for this 
purpose, but it does work filtering a report)
-- 
Dave Hargis, Microsoft Access MVP


"John Petty" wrote:

> In short, I am trying to use the listbox to filter the data.  If possible, I 
> am wanting to use this method throughout my app.
> 
> "John Petty" wrote:
> 
> > Dave, 
> > 
> > Thanks for the response.  I would have responded sooner but I had a calculus 
> > class to attend.
> > 
> > That being said, I tried to set the master and child field links to tje 
> > field names but to no avail.  I get input boxes asking for the field 
> > criteria, or when I link all fields in the listbox, I get an error stating 
> > that I must have the same number of fields defined on both the Master and 
> > Child link fields (and I do and in the same order).
> > 
> > I did forget to mention that I have the listbox on on tab control and the 
> > subform on another. Could this be the problem? If so, how can I define the 
> > code to link them together?
> > 
> > 
> > "Klatuu" wrote:
> > 
> > > You don't use form controls in the link master and link child properties of 
> > > the subform control.  Use the names of fields in the form and subform 
> > > recordsets.
> > > -- 
> > > Dave Hargis, Microsoft Access MVP
> > > 
> > > 
> > > "John Petty" wrote:
> > > 
> > > > I have a listbox that is populated from a sub query (qyListFEA). I have set 
> > > > the subform's LinkMasterField and LinkChildField to this listbox.
> > > > 
> > > > The list box contains 3 columns (Project Name, Project Number and Iteration). 
> > > > 
> > > > When I select let's say Wheel 1, 5214, 1C, the subform only shows the Wheel 
> > > > 1 at iteration 1.
> > > > 
> > > > How can I get the data to synchronize so that if I select Wheel 1 at 
> > > > iteration 1c or 2, etc. I can get the correct record to show?
> > > > 
> > > > Note: the sub query "qyListFEA" is based upon "qyFEA" which is where I need 
> > > > the actual data from.  If I use the master query in the listbox, I get a 
> > > > bunch of ID's instead of the text.
> > > > 
> > > > Any help would be appreciated.
> > > > 
> > > > 
0
Utf
1/14/2008 9:26:00 PM
As far as the number of items that would be in the listbox at any one time, 
maybe 25-30 items. (This list box is designed to show all active projects (we 
have a quick throughput time. Signoff is the only bottleneck)).

Also, this is not a multiselect list box.

I will see how well my coding skills work and try to create a counter and a 
DLookup filter. 

"Klatuu" wrote:

> As I said before, you have to link the data in the subform to the data in the 
> master form using the fields in the tables.  There is no way to link using 
> any kind of control.
> 
> You could filter the data, but depending how may rows are in your list box, 
> it may cause the form to appear slow.
> 
> Is this a multi select list box?  If so, I can send you a function that will 
> return a string you can use for filtering (note, I have not used it for this 
> purpose, but it does work filtering a report)
> -- 
> Dave Hargis, Microsoft Access MVP
> 
> 
> "John Petty" wrote:
> 
> > In short, I am trying to use the listbox to filter the data.  If possible, I 
> > am wanting to use this method throughout my app.
> > 
> > "John Petty" wrote:
> > 
> > > Dave, 
> > > 
> > > Thanks for the response.  I would have responded sooner but I had a calculus 
> > > class to attend.
> > > 
> > > That being said, I tried to set the master and child field links to tje 
> > > field names but to no avail.  I get input boxes asking for the field 
> > > criteria, or when I link all fields in the listbox, I get an error stating 
> > > that I must have the same number of fields defined on both the Master and 
> > > Child link fields (and I do and in the same order).
> > > 
> > > I did forget to mention that I have the listbox on on tab control and the 
> > > subform on another. Could this be the problem? If so, how can I define the 
> > > code to link them together?
> > > 
> > > 
> > > "Klatuu" wrote:
> > > 
> > > > You don't use form controls in the link master and link child properties of 
> > > > the subform control.  Use the names of fields in the form and subform 
> > > > recordsets.
> > > > -- 
> > > > Dave Hargis, Microsoft Access MVP
> > > > 
> > > > 
> > > > "John Petty" wrote:
> > > > 
> > > > > I have a listbox that is populated from a sub query (qyListFEA). I have set 
> > > > > the subform's LinkMasterField and LinkChildField to this listbox.
> > > > > 
> > > > > The list box contains 3 columns (Project Name, Project Number and Iteration). 
> > > > > 
> > > > > When I select let's say Wheel 1, 5214, 1C, the subform only shows the Wheel 
> > > > > 1 at iteration 1.
> > > > > 
> > > > > How can I get the data to synchronize so that if I select Wheel 1 at 
> > > > > iteration 1c or 2, etc. I can get the correct record to show?
> > > > > 
> > > > > Note: the sub query "qyListFEA" is based upon "qyFEA" which is where I need 
> > > > > the actual data from.  If I use the master query in the listbox, I get a 
> > > > > bunch of ID's instead of the text.
> > > > > 
> > > > > Any help would be appreciated.
> > > > > 
> > > > > 
0
Utf
1/14/2008 9:39:03 PM
You don't need a count or a dlookup.  If it is a single select list box, you 
need to set the subforms filter using the current value of the list box:
In the code below, please not that sfrmStuff is the name of the subform 
control on the main form, not the name of the form being used in the subform 
control.  Also, all other names are made up:

    If Not IsNull(Me.MyListBox) Then
        Me.sfrmStuff.Form.Filter = "[Some Field] = '" & Me.MyListBox & "'"
        Me.sfrmStuff.Form.FilterOn = True
    End If

Now, if it happens the list box has multiple columns, you can use the list 
box Column property to identify which column to use.  Note the Column 
property index starts at 0, so the first column in the list is .Column(0) and 
the second is .Column(1), etc.

        Me.sfrmStuff.Form.Filter = "[Some Field] = '" & 
Me.MyListBox.Column(3) & "'"

-- 
Dave Hargis, Microsoft Access MVP


"John Petty" wrote:

> As far as the number of items that would be in the listbox at any one time, 
> maybe 25-30 items. (This list box is designed to show all active projects (we 
> have a quick throughput time. Signoff is the only bottleneck)).
> 
> Also, this is not a multiselect list box.
> 
> I will see how well my coding skills work and try to create a counter and a 
> DLookup filter. 
> 
> "Klatuu" wrote:
> 
> > As I said before, you have to link the data in the subform to the data in the 
> > master form using the fields in the tables.  There is no way to link using 
> > any kind of control.
> > 
> > You could filter the data, but depending how may rows are in your list box, 
> > it may cause the form to appear slow.
> > 
> > Is this a multi select list box?  If so, I can send you a function that will 
> > return a string you can use for filtering (note, I have not used it for this 
> > purpose, but it does work filtering a report)
> > -- 
> > Dave Hargis, Microsoft Access MVP
> > 
> > 
> > "John Petty" wrote:
> > 
> > > In short, I am trying to use the listbox to filter the data.  If possible, I 
> > > am wanting to use this method throughout my app.
> > > 
> > > "John Petty" wrote:
> > > 
> > > > Dave, 
> > > > 
> > > > Thanks for the response.  I would have responded sooner but I had a calculus 
> > > > class to attend.
> > > > 
> > > > That being said, I tried to set the master and child field links to tje 
> > > > field names but to no avail.  I get input boxes asking for the field 
> > > > criteria, or when I link all fields in the listbox, I get an error stating 
> > > > that I must have the same number of fields defined on both the Master and 
> > > > Child link fields (and I do and in the same order).
> > > > 
> > > > I did forget to mention that I have the listbox on on tab control and the 
> > > > subform on another. Could this be the problem? If so, how can I define the 
> > > > code to link them together?
> > > > 
> > > > 
> > > > "Klatuu" wrote:
> > > > 
> > > > > You don't use form controls in the link master and link child properties of 
> > > > > the subform control.  Use the names of fields in the form and subform 
> > > > > recordsets.
> > > > > -- 
> > > > > Dave Hargis, Microsoft Access MVP
> > > > > 
> > > > > 
> > > > > "John Petty" wrote:
> > > > > 
> > > > > > I have a listbox that is populated from a sub query (qyListFEA). I have set 
> > > > > > the subform's LinkMasterField and LinkChildField to this listbox.
> > > > > > 
> > > > > > The list box contains 3 columns (Project Name, Project Number and Iteration). 
> > > > > > 
> > > > > > When I select let's say Wheel 1, 5214, 1C, the subform only shows the Wheel 
> > > > > > 1 at iteration 1.
> > > > > > 
> > > > > > How can I get the data to synchronize so that if I select Wheel 1 at 
> > > > > > iteration 1c or 2, etc. I can get the correct record to show?
> > > > > > 
> > > > > > Note: the sub query "qyListFEA" is based upon "qyFEA" which is where I need 
> > > > > > the actual data from.  If I use the master query in the listbox, I get a 
> > > > > > bunch of ID's instead of the text.
> > > > > > 
> > > > > > Any help would be appreciated.
> > > > > > 
> > > > > > 
0
Utf
1/14/2008 9:48:01 PM
Dave, 

What event do I place the 'Multi-Column" code into. I don't see a change 
event for the Listbox or the fmFEAData form

Also, I need 2 of the listbox columns to match for the record. (i.e. Project 
Name and Iteration since I can have up to 99 iterations for the same project)

"Klatuu" wrote:

> You don't need a count or a dlookup.  If it is a single select list box, you 
> need to set the subforms filter using the current value of the list box:
> In the code below, please not that sfrmStuff is the name of the subform 
> control on the main form, not the name of the form being used in the subform 
> control.  Also, all other names are made up:
> 
>     If Not IsNull(Me.MyListBox) Then
>         Me.sfrmStuff.Form.Filter = "[Some Field] = '" & Me.MyListBox & "'"
>         Me.sfrmStuff.Form.FilterOn = True
>     End If
> 
> Now, if it happens the list box has multiple columns, you can use the list 
> box Column property to identify which column to use.  Note the Column 
> property index starts at 0, so the first column in the list is .Column(0) and 
> the second is .Column(1), etc.
> 
>         Me.sfrmStuff.Form.Filter = "[Some Field] = '" & 
> Me.MyListBox.Column(3) & "'"
> 
> -- 
> Dave Hargis, Microsoft Access MVP
> 
> 
> "John Petty" wrote:
> 
> > As far as the number of items that would be in the listbox at any one time, 
> > maybe 25-30 items. (This list box is designed to show all active projects (we 
> > have a quick throughput time. Signoff is the only bottleneck)).
> > 
> > Also, this is not a multiselect list box.
> > 
> > I will see how well my coding skills work and try to create a counter and a 
> > DLookup filter. 
> > 
> > "Klatuu" wrote:
> > 
> > > As I said before, you have to link the data in the subform to the data in the 
> > > master form using the fields in the tables.  There is no way to link using 
> > > any kind of control.
> > > 
> > > You could filter the data, but depending how may rows are in your list box, 
> > > it may cause the form to appear slow.
> > > 
> > > Is this a multi select list box?  If so, I can send you a function that will 
> > > return a string you can use for filtering (note, I have not used it for this 
> > > purpose, but it does work filtering a report)
> > > -- 
> > > Dave Hargis, Microsoft Access MVP
> > > 
> > > 
> > > "John Petty" wrote:
> > > 
> > > > In short, I am trying to use the listbox to filter the data.  If possible, I 
> > > > am wanting to use this method throughout my app.
> > > > 
> > > > "John Petty" wrote:
> > > > 
> > > > > Dave, 
> > > > > 
> > > > > Thanks for the response.  I would have responded sooner but I had a calculus 
> > > > > class to attend.
> > > > > 
> > > > > That being said, I tried to set the master and child field links to tje 
> > > > > field names but to no avail.  I get input boxes asking for the field 
> > > > > criteria, or when I link all fields in the listbox, I get an error stating 
> > > > > that I must have the same number of fields defined on both the Master and 
> > > > > Child link fields (and I do and in the same order).
> > > > > 
> > > > > I did forget to mention that I have the listbox on on tab control and the 
> > > > > subform on another. Could this be the problem? If so, how can I define the 
> > > > > code to link them together?
> > > > > 
> > > > > 
> > > > > "Klatuu" wrote:
> > > > > 
> > > > > > You don't use form controls in the link master and link child properties of 
> > > > > > the subform control.  Use the names of fields in the form and subform 
> > > > > > recordsets.
> > > > > > -- 
> > > > > > Dave Hargis, Microsoft Access MVP
> > > > > > 
> > > > > > 
> > > > > > "John Petty" wrote:
> > > > > > 
> > > > > > > I have a listbox that is populated from a sub query (qyListFEA). I have set 
> > > > > > > the subform's LinkMasterField and LinkChildField to this listbox.
> > > > > > > 
> > > > > > > The list box contains 3 columns (Project Name, Project Number and Iteration). 
> > > > > > > 
> > > > > > > When I select let's say Wheel 1, 5214, 1C, the subform only shows the Wheel 
> > > > > > > 1 at iteration 1.
> > > > > > > 
> > > > > > > How can I get the data to synchronize so that if I select Wheel 1 at 
> > > > > > > iteration 1c or 2, etc. I can get the correct record to show?
> > > > > > > 
> > > > > > > Note: the sub query "qyListFEA" is based upon "qyFEA" which is where I need 
> > > > > > > the actual data from.  If I use the master query in the listbox, I get a 
> > > > > > > bunch of ID's instead of the text.
> > > > > > > 
> > > > > > > Any help would be appreciated.
> > > > > > > 
> > > > > > > 
0
Utf
1/14/2008 10:33:21 PM
-- 
Dave Hargis, Microsoft Access MVP


"John Petty" wrote:

> Dave, 
> 
> What event do I place the 'Multi-Column" code into. I don't see a change 
> event for the Listbox or the fmFEAData form

Since I don't know how your form works, I can't say.
> 
> Also, I need 2 of the listbox columns to match for the record. (i.e. Project 
> Name and Iteration since I can have up to 99 iterations for the same project)

Is the Iteration a value in the child table?  If it is not in the  parent 
table, then you would have to add code to whatever event you use to populate 
the subform to filter on that value.
> 
> "Klatuu" wrote:
> 
> > You don't need a count or a dlookup.  If it is a single select list box, you 
> > need to set the subforms filter using the current value of the list box:
> > In the code below, please not that sfrmStuff is the name of the subform 
> > control on the main form, not the name of the form being used in the subform 
> > control.  Also, all other names are made up:
> > 
> >     If Not IsNull(Me.MyListBox) Then
> >         Me.sfrmStuff.Form.Filter = "[Some Field] = '" & Me.MyListBox & "'"
> >         Me.sfrmStuff.Form.FilterOn = True
> >     End If
> > 
> > Now, if it happens the list box has multiple columns, you can use the list 
> > box Column property to identify which column to use.  Note the Column 
> > property index starts at 0, so the first column in the list is .Column(0) and 
> > the second is .Column(1), etc.
> > 
> >         Me.sfrmStuff.Form.Filter = "[Some Field] = '" & 
> > Me.MyListBox.Column(3) & "'"
> > 
> > -- 
> > Dave Hargis, Microsoft Access MVP
> > 
> > 
> > "John Petty" wrote:
> > 
> > > As far as the number of items that would be in the listbox at any one time, 
> > > maybe 25-30 items. (This list box is designed to show all active projects (we 
> > > have a quick throughput time. Signoff is the only bottleneck)).
> > > 
> > > Also, this is not a multiselect list box.
> > > 
> > > I will see how well my coding skills work and try to create a counter and a 
> > > DLookup filter. 
> > > 
> > > "Klatuu" wrote:
> > > 
> > > > As I said before, you have to link the data in the subform to the data in the 
> > > > master form using the fields in the tables.  There is no way to link using 
> > > > any kind of control.
> > > > 
> > > > You could filter the data, but depending how may rows are in your list box, 
> > > > it may cause the form to appear slow.
> > > > 
> > > > Is this a multi select list box?  If so, I can send you a function that will 
> > > > return a string you can use for filtering (note, I have not used it for this 
> > > > purpose, but it does work filtering a report)
> > > > -- 
> > > > Dave Hargis, Microsoft Access MVP
> > > > 
> > > > 
> > > > "John Petty" wrote:
> > > > 
> > > > > In short, I am trying to use the listbox to filter the data.  If possible, I 
> > > > > am wanting to use this method throughout my app.
> > > > > 
> > > > > "John Petty" wrote:
> > > > > 
> > > > > > Dave, 
> > > > > > 
> > > > > > Thanks for the response.  I would have responded sooner but I had a calculus 
> > > > > > class to attend.
> > > > > > 
> > > > > > That being said, I tried to set the master and child field links to tje 
> > > > > > field names but to no avail.  I get input boxes asking for the field 
> > > > > > criteria, or when I link all fields in the listbox, I get an error stating 
> > > > > > that I must have the same number of fields defined on both the Master and 
> > > > > > Child link fields (and I do and in the same order).
> > > > > > 
> > > > > > I did forget to mention that I have the listbox on on tab control and the 
> > > > > > subform on another. Could this be the problem? If so, how can I define the 
> > > > > > code to link them together?
> > > > > > 
> > > > > > 
> > > > > > "Klatuu" wrote:
> > > > > > 
> > > > > > > You don't use form controls in the link master and link child properties of 
> > > > > > > the subform control.  Use the names of fields in the form and subform 
> > > > > > > recordsets.
> > > > > > > -- 
> > > > > > > Dave Hargis, Microsoft Access MVP
> > > > > > > 
> > > > > > > 
> > > > > > > "John Petty" wrote:
> > > > > > > 
> > > > > > > > I have a listbox that is populated from a sub query (qyListFEA). I have set 
> > > > > > > > the subform's LinkMasterField and LinkChildField to this listbox.
> > > > > > > > 
> > > > > > > > The list box contains 3 columns (Project Name, Project Number and Iteration). 
> > > > > > > > 
> > > > > > > > When I select let's say Wheel 1, 5214, 1C, the subform only shows the Wheel 
> > > > > > > > 1 at iteration 1.
> > > > > > > > 
> > > > > > > > How can I get the data to synchronize so that if I select Wheel 1 at 
> > > > > > > > iteration 1c or 2, etc. I can get the correct record to show?
> > > > > > > > 
> > > > > > > > Note: the sub query "qyListFEA" is based upon "qyFEA" which is where I need 
> > > > > > > > the actual data from.  If I use the master query in the listbox, I get a 
> > > > > > > > bunch of ID's instead of the text.
> > > > > > > > 
> > > > > > > > Any help would be appreciated.
> > > > > > > > 
> > > > > > > > 
0
Utf
1/14/2008 11:08:00 PM
Klatuu wrote:
> As I said before, you have to link the data in the subform to the
> data in the master form using the fields in the tables.  There is no
> way to link using any kind of control.

That is actually only true of the ChildLink property.  The MasterLink property 
can be set to the name of a control, even an umbound control.  In fact this is 
what you are forced to do when the parent form is unbound (not your typical 
scenario granted).

You just can't use the builder to make the setting, but have to type it into the 
property box manually.

-- 
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt   at   Hunter   dot   com 


0
Rick
1/15/2008 1:03:21 AM
Dave, 

The iteration value is both a column in the Listbox and a textbox field in 
the subform.

I can get the subform to populate based upon the Project Name  from the 
Listbox, but I can't seem to get the subform to acknowledge the correct 
record (i.e. wheelName, Iteration).

I tried using DLookup("[FIteration]", "[qyFEA]", "[WheelName] =" & 
lbWheels.Column(3)), (where qyFEA is the master query (from which the 
qyListFEA is based upon, and lbWHeels is the Listbox), 

But I get an error that the Column Object is being used incorrectly. 

FListC = Forms!fmFormMaster.Controls!LbWheels

With FListC
If DLookup("WheelName", "qyFEA", "WheelName ='" & Me.Column(1) & "'") And _
    DLookup("FIteration", "qyFEA", "WheelName ='" & Me.Column(1) & "'") Then

    DoCmd.FindRecord , , acEntire
End If

and  I tried the following filter code in the subform "Filter Event"

Private Sub Form_Filter(Cancel As Integer, FilterType As Integer)
If Not IsNull(Forms!fmMasterForm!Controls.LbWheels) Then

Me.Filter = "[WheelName] ='" & 
Forms!fmMasterForm!Controls.LbWheels.Column(3) & "'"

End If
End Sub

The same error comes up.  

This is definitely user error, but I can't seem to debug it out.




"Klatuu" wrote:

> 
> -- 
> Dave Hargis, Microsoft Access MVP
> 
> 
> "John Petty" wrote:
> 
> > Dave, 
> > 
> > What event do I place the 'Multi-Column" code into. I don't see a change 
> > event for the Listbox or the fmFEAData form
> 
> Since I don't know how your form works, I can't say.
> > 
> > Also, I need 2 of the listbox columns to match for the record. (i.e. Project 
> > Name and Iteration since I can have up to 99 iterations for the same project)
> 
> Is the Iteration a value in the child table?  If it is not in the  parent 
> table, then you would have to add code to whatever event you use to populate 
> the subform to filter on that value.
> > 
> > "Klatuu" wrote:
> > 
> > > You don't need a count or a dlookup.  If it is a single select list box, you 
> > > need to set the subforms filter using the current value of the list box:
> > > In the code below, please not that sfrmStuff is the name of the subform 
> > > control on the main form, not the name of the form being used in the subform 
> > > control.  Also, all other names are made up:
> > > 
> > >     If Not IsNull(Me.MyListBox) Then
> > >         Me.sfrmStuff.Form.Filter = "[Some Field] = '" & Me.MyListBox & "'"
> > >         Me.sfrmStuff.Form.FilterOn = True
> > >     End If
> > > 
> > > Now, if it happens the list box has multiple columns, you can use the list 
> > > box Column property to identify which column to use.  Note the Column 
> > > property index starts at 0, so the first column in the list is .Column(0) and 
> > > the second is .Column(1), etc.
> > > 
> > >         Me.sfrmStuff.Form.Filter = "[Some Field] = '" & 
> > > Me.MyListBox.Column(3) & "'"
> > > 
> > > -- 
> > > Dave Hargis, Microsoft Access MVP
> > > 
> > > 
> > > "John Petty" wrote:
> > > 
> > > > As far as the number of items that would be in the listbox at any one time, 
> > > > maybe 25-30 items. (This list box is designed to show all active projects (we 
> > > > have a quick throughput time. Signoff is the only bottleneck)).
> > > > 
> > > > Also, this is not a multiselect list box.
> > > > 
> > > > I will see how well my coding skills work and try to create a counter and a 
> > > > DLookup filter. 
> > > > 
> > > > "Klatuu" wrote:
> > > > 
> > > > > As I said before, you have to link the data in the subform to the data in the 
> > > > > master form using the fields in the tables.  There is no way to link using 
> > > > > any kind of control.
> > > > > 
> > > > > You could filter the data, but depending how may rows are in your list box, 
> > > > > it may cause the form to appear slow.
> > > > > 
> > > > > Is this a multi select list box?  If so, I can send you a function that will 
> > > > > return a string you can use for filtering (note, I have not used it for this 
> > > > > purpose, but it does work filtering a report)
> > > > > -- 
> > > > > Dave Hargis, Microsoft Access MVP
> > > > > 
> > > > > 
> > > > > "John Petty" wrote:
> > > > > 
> > > > > > In short, I am trying to use the listbox to filter the data.  If possible, I 
> > > > > > am wanting to use this method throughout my app.
> > > > > > 
> > > > > > "John Petty" wrote:
> > > > > > 
> > > > > > > Dave, 
> > > > > > > 
> > > > > > > Thanks for the response.  I would have responded sooner but I had a calculus 
> > > > > > > class to attend.
> > > > > > > 
> > > > > > > That being said, I tried to set the master and child field links to tje 
> > > > > > > field names but to no avail.  I get input boxes asking for the field 
> > > > > > > criteria, or when I link all fields in the listbox, I get an error stating 
> > > > > > > that I must have the same number of fields defined on both the Master and 
> > > > > > > Child link fields (and I do and in the same order).
> > > > > > > 
> > > > > > > I did forget to mention that I have the listbox on on tab control and the 
> > > > > > > subform on another. Could this be the problem? If so, how can I define the 
> > > > > > > code to link them together?
> > > > > > > 
> > > > > > > 
> > > > > > > "Klatuu" wrote:
> > > > > > > 
> > > > > > > > You don't use form controls in the link master and link child properties of 
> > > > > > > > the subform control.  Use the names of fields in the form and subform 
> > > > > > > > recordsets.
> > > > > > > > -- 
> > > > > > > > Dave Hargis, Microsoft Access MVP
> > > > > > > > 
> > > > > > > > 
> > > > > > > > "John Petty" wrote:
> > > > > > > > 
> > > > > > > > > I have a listbox that is populated from a sub query (qyListFEA). I have set 
> > > > > > > > > the subform's LinkMasterField and LinkChildField to this listbox.
> > > > > > > > > 
> > > > > > > > > The list box contains 3 columns (Project Name, Project Number and Iteration). 
> > > > > > > > > 
> > > > > > > > > When I select let's say Wheel 1, 5214, 1C, the subform only shows the Wheel 
> > > > > > > > > 1 at iteration 1.
> > > > > > > > > 
> > > > > > > > > How can I get the data to synchronize so that if I select Wheel 1 at 
> > > > > > > > > iteration 1c or 2, etc. I can get the correct record to show?
> > > > > > > > > 
> > > > > > > > > Note: the sub query "qyListFEA" is based upon "qyFEA" which is where I need 
> > > > > > > > > the actual data from.  If I use the master query in the listbox, I get a 
> > > > > > > > > bunch of ID's instead of the text.
> > > > > > > > > 
> > > > > > > > > Any help would be appreciated.
> > > > > > > > > 
> > > > > > > > > 
0
Utf
1/15/2008 1:42:01 PM
Thanks, Rick.  I was not aware of that.
-- 
Dave Hargis, Microsoft Access MVP


"Rick Brandt" wrote:

> Klatuu wrote:
> > As I said before, you have to link the data in the subform to the
> > data in the master form using the fields in the tables.  There is no
> > way to link using any kind of control.
> 
> That is actually only true of the ChildLink property.  The MasterLink property 
> can be set to the name of a control, even an umbound control.  In fact this is 
> what you are forced to do when the parent form is unbound (not your typical 
> scenario granted).
> 
> You just can't use the builder to make the setting, but have to type it into the 
> property box manually.
> 
> -- 
> Rick Brandt, Microsoft Access MVP
> Email (as appropriate) to...
> RBrandt   at   Hunter   dot   com 
> 
> 
> 
0
Utf
1/15/2008 2:13:03 PM
Rick, 

If I use the control "lbWheels" in the LinkMasterField object, how can I 
access the 2 columns that I need to match for my subform to sychronize and 
populate properly?

"Rick Brandt" wrote:

> Klatuu wrote:
> > As I said before, you have to link the data in the subform to the
> > data in the master form using the fields in the tables.  There is no
> > way to link using any kind of control.
> 
> That is actually only true of the ChildLink property.  The MasterLink property 
> can be set to the name of a control, even an umbound control.  In fact this is 
> what you are forced to do when the parent form is unbound (not your typical 
> scenario granted).
> 
> You just can't use the builder to make the setting, but have to type it into the 
> property box manually.
> 
> -- 
> Rick Brandt, Microsoft Access MVP
> Email (as appropriate) to...
> RBrandt   at   Hunter   dot   com 
> 
> 
> 
0
Utf
1/15/2008 5:18:01 PM
John Petty wrote:
> Rick,
>
> If I use the control "lbWheels" in the LinkMasterField object, how
> can I access the 2 columns that I need to match for my subform to
> sychronize and populate properly?

If you need to refernec two field in the ChildLink property then you need to 
have two references in the MasterLink property.  If the two values are found in 
tow different column of the ListBox then you can use...

lbWheels.column(0);lbWheels.column(1)

-- 
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt   at   Hunter   dot   com


0
Rick
1/16/2008 12:15:30 AM
Reply:

Similar Artilces:

Exchange 2003 Forms Based Authentication
Has anybody implemented FBA on Exchange 2003 with ISA 2004? I need FBA turned on in Exchange 2003 but not turned on at the ISA level. Any help would be appreciated. On Mon, 11 Oct 2004 08:14:33 -0700, "Mike L" <anonymous@discussions.microsoft.com> wrote: >Has anybody implemented FBA on Exchange 2003 with ISA >2004? I need FBA turned on in Exchange 2003 but not >turned on at the ISA level. Any help would be appreciated. Indeed. This: http://www.isaserver.org/tutorials/2004pubowamobile.html Gives you what you need and also an insight on some other stuff that you c...

correct formulation of expression in control source
How can I combine 2 expressions that use the DCount function? For example, in control source, =DCount("[Field1]","qryX","[Field1]=True") will give me a value Y which I need to add to another value obtained by =DCount("[Field1]",qryZ","[Field1]=True"). I have tried various bits such as =DCount("[Field1]","qryX" And "qryZ","[Field1]=True") but that does not work. Can anyone help? Regards Have you tried =DCount("[Field1]","qryX","[Field1]=True") + DCount("[Field1...

I want to set up a form in excel where I can place a jpeg or pic.
The goal is to set up an excel form where I can place a jpeg or pic. I am very low level excel user but this is a big deal document for me. What do you plan to do with it Karl? Could you give us more information? I mean... you can just use Insert-->Picture-->From file to insert a jpg. What do you want to do? ******************* ~Anne Troy www.OfficeArticles.com www.MyExpertsOnline.com "karl" <karl@discussions.microsoft.com> wrote in message news:787A30AE-3809-4466-85DE-DA56A0E99616@microsoft.com... > The goal is to set up an excel form where I can place a jpeg o...

Adding variables to a static text control (displaying contents of array)
Hello, I was wondering if the following was possible ? I have a static text control in a dialog application. I also have an array which contains about 5 items. I would like the text control to display the contents of this array and then have a button which would move to next position into the array and thus the static text control would display something different ? How could achieve this? I'm using Visual Studio 6.0 and I'm quite new to MFC Many Thanks. >I have a static text control in a dialog application. I also have an >array which contains about 5 items. I would lik...

Sub Accounts : Owners
We have Resellers & Sub Accounts. The Owner of a Reseller is a sales person, the Owner of a Sub-Account is Customer Care. How do we reassign a Reseller to another sales person with out the Sub Account Owner's name being changed to the same sales person? We can manually change the Owner of these Sub Accounts, but this is a tedious process. Can anyone advise pse? Tracy Hi, In Microsoft CRM this has to do with the behavior of the relationship. Unfortunately it is not possible to change the behavior for subaccounts. If you change the ownership of an account the owner of the subac...

How do I freeze lines on a form
I have a form that was created in word that co-workers have to type on with client information. How do I make the lines & boxes freeze so that when they do type on it it doesn't move? Insert a table. Put each form field in a separate cell of the table. In the Table Properties dialog, Rows tab, set the row heights to "Exactly" values. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. rauten46 wrote: > I have a form that was created i...

Signing ActiveX Controls
Hi, After creating an activex control, I used the SIGNCODE utility that comes with InstallShield Professional 6.3 to sign my .ocx file. Its asking for the certificate to use, which I don't have. How to aquire this certificate? and is it what I need to install and run my activex controls on client machines (when embedding the control into HTML document using OBJECT tag)? Thanx. I did this few years ago. I got the certificate from Verisign. They give you all the info including how to sign it using microsoft's technology. It used to cost around ~$400. Your clients can still us...

Controls on Form Limit
Is there a limit to the number of controls that can be on a form? I have have a big problem with a form I just finished designing and I am sure it is because of the amount of controls I have on the form. Any ideas. There is a limit of 754 controls over the life time of the form. Note that that means if you started with some controls and then deleted them, those are still part of the count. There's no way to reset the count. What you can do, however, is copy all of the controls on the form onto a new form (and copy the code from the form's module). -- Doug Steele, Microsoft Acc...

Method of calling a function where function name is stored in a variable or control
Is there a way to call a function (or sub for that matter) where the function/sub name is stored in a variable? For instance lets say I have a table that stores some function names. On a form I have a list box that displays the records in that table. For this example lets say they all accomplish similar things and all require the same numbef of arguments and none of them return a value. If Call were the right method to accomplis this it might look sometihng like this Dim lngArgument as Long lngArgument = 1234 Call Me.lstBox, lngArgument In this case Call would run the function...

Change dollar amt to written form
Is there a formula on changing numerical dollar amt to their written-out form? If there is, can you tell me? Hi, There are several versions of this available, I like this one http://www.ozgrid.com/VBA/ValueToWords.htm Mike "Shihachi" wrote: > Is there a formula on changing numerical dollar amt to their written-out > form? If there is, can you tell me? There is: http://support.microsoft.com/default.aspx/kb/213360 Micky "Shihachi" wrote: > Is there a formula on changing numerical dollar amt to their written-out > form? If there i...

Split Form with need to Provide Selection List
We have an Access 2007 application that has a split form (built on Table-1). We now need to add some type of facility that will allow our users to view data from Table-2 (while working on the Split form based on Table-1). They will then select one row from Table-2 which will contain 6 fields which we need to plug into Table-1. We are still fairly new to Access and we are not sure of the best way to accomplish this task. Thank You, Brad ...

How to requery a form from sub form
access 2007 How to requery a form from sub form Example: I have master form with 2 subform, the 2 subform have the same (data source) I want when edit one of them the edit apply to the other form i'm sorry the question is How to requery subform from subform on the master form? "a" <A@a.com> wrote in message news:emv4%23flSIHA.4768@TK2MSFTNGP02.phx.gbl... > access 2007 > > How to requery a form from sub form > > Example: > > I have master form with 2 subform, the 2 subform have the same (data > source) > > I want when edit one of them ...

Custom Tool bar button on Contacts/Leads/Account Forms Intermittently not working.
Hello CRM gurus, I have a weird issue with a clients web CRM 3 client. I have modified the 'isv.config.xml' and 'isv.confg' files to add a custom button to the contacts/leads/account forms. What seems to be happen, at times (seems to be random) the picture of the button doesn't show up, but the text does and the you cannot click on the button anymore. It only happens to one client PC, as the rest of the client PCs work without any problems. I have run out of ideas as to why this is occurring. Are there any log files that I can look at? Any help on this problem will be g...

Form feeding a table problem
I am a newer user of Access and inherited a database from a person no longer with the company. I am using a form to input invoice amounts into an invoice table. The form uses a parameter query to ask for invoice number. When the form opens, I have it pulling customer info from a customer table, which it displays on the form. I then enter more invoice info. When I look at the invoice table after I close the form, the info I typed (invoice update) is there, but the customer info that is automatically pulled doesn't load from the customer table to the invoice table. How can I g...

dynamically created subclassed CComboBox doesnot recieve CBN_SELCHANGE in Activex Control
hi, Please ignore this post if a similar one appears. I posted yesterday and the post has not appeared on the NG yet. That said, let me explain the problem : I subclassed the CComboBox and am placing it on a CToolBar derivative. Both the combobox and the toolbar are created dynamically. I wish to trap the CBN_SELCHANGE message of the combobox and do some action in there. But the combobox doesnot seem to recieve the message (more precisely, the handler is never called).All this is in a classwizard generated MFC based Activex Control. Here is what I do: 1. In the main COleControl deri...

Form Query
I am trying to run a query for a form, I am using the following criteria [form]![frmSchoolsQry]![txtschool] . The form name and the text box from the form. When I click the command button the launch the query a parameter dialog pop up. The dialog ask for the text that is in the text box. I use forms to query dates, they work great, why don’t this work? Any suggestions? You're missing an s in Form: [Forms]![frmSchoolsQry]![txtschool] -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "rap43" <rap43@discussions.microsoft.com>...

How to get out of a listbox?
Hi! Need a little help please. Question, how do I terminate/close the listbox after the user made one selection? My code filling up a the listbox and calling a Userform1 Thank's ahead for any pointers. Sub slist() i = 1 For Each ws In Worksheets UserForm1.ListBox1.AddItem (Worksheets(i).Name) i = i + 1 Next ws UserForm1.Show End Sub Userform1 code:---------------------------------------- Private Sub ListBox1_Click() Sheets(UserForm1.ListBox1.Value).Select End Sub Not sure I have got the problem, but maybe try Sub slist() i = 1 Userform1.Listbox1.Clear For Each ws In Wor...

Dropdowns to Activex listboxes
Hi All, I have 8 dropdown boxes on a worksheet that reference an array (A5:A12 on a different worksheet (Player Array) and once a team is selecte form the dropdown the team members are added into the sheet auto, wha I want to do is change the dropdowns for activex listboxes so I hav more control over the properties ie: font size. How can I do this :( I can get the listboxes there but I cant seem t get them referencing the array. If you need a copy of the file pleas let me know. Any help much appreciated Thanks Ro -- Message posted from http://www.ExcelForum.com Open the Control toolbox,...

FORM and ACTION stripped in OWA 2003
Our company has a product that sends out form-like emails. Users fill out the information in the email, press a submit button, and their responses are recorded on our server. This works find with most mail clients, including Outlook 2000 and 2003. However, in OWA 2003, it appears that the FORM and ACTION elements are stripped from the email, so the forms don't work. Is there any way to modify the behavior of OWA2003 with respect to which html verbs are blocked? Sample code from the emails is shown below: <form name="payments" method="get" action="htt...

Search Form?????????
Hey yeah I was wondering if it was possible to make a form that will search your database and find what you are searching for but using a text box and a button next to it to search and if you don't type in the whole thing it will find and match words like for example you are looking for 1" wrench but you type in wrench and press search and everyone with wrench in it will come up. I don't know if this is possible if it is can someone please tell me how to make it thank you. ...

Drag and drop between ListBoxes
I have a Form with two ListBoxes on either side of a SplitContainer control. Each ListBox has a number of strings in it. I need to be able to move strings between the two at will. However, the built in drag and drop functionality seems very, very, limited (ie, nothing more than functionally useless cursor changes and additional events that would be easily attainable without built in dragging and dropping). I am having issues with removing the old data from the original ListBox. I tried {source ListBox}.Remove({data that was dragged}); in the DragDrop event but it only works s...

Add Record to Subform using a Listbox
I have a Form with a Subform. The Form contains a multi-select List Box for selection of records to add to the Subform. I can’t seem to get the code right to accomplish this. Any help would be very much appreciated. FrmEvents (contains List Box: “lstDefs” & subform: “frmSubEventDef”) Record Source: q_frm_event Primary key: EventNo lstDefs (Unbound) Field 1: DefNo Field 2: Defintion Multi-Select: Extended frmSubEventDef Record Source: q_frm_event_defs Field 1: EventNo Field 2: DefNo Link Child Fields: EventNo Link Master Fields: EventNo On selection of specific row(s) in lstDefs, th...

Can I add a new tax "form line"?
I have Money 2004 (Small Business Edition). There is a relatively new line on the 1040 called Self-Employed Health Insurance Deduction (line 29) that doesn't exist in Money. Unfortunately, when I try the "add a tax line" function (in the Tax Line Manager), it forces me to select one of the pre-existing "form line" options for the 1040 form. I'm trying to figure out how I can update this list with a new form line for this item. I've tried doing the tax update on the tax settings page, but it doesn't help. Any ideas? In microsoft.public.money, c...

Multiple selections in Listbox
I have 2 Excel VBA questions: 1) Is it possible to choose multiple items in a List Box and if so, 2) how can I use those selected items in a macro (which variable type should I use?) For example. I have selected three country in a listbox and I want to print the sales results of each of those three countries. Asume in this case that I use for each country one worksheet. Your suggestions and tips are very appreciated! Thanks! Best regards, Christiaan Hi there, It depends on what kind of listbox you have created. If you have created one from the Controls Toolbox menu (an ActiveX c...

MS Money 2006: How do I set up a sub-account?
I'm using Microsoft Money 2006 Premium. I've got a savings account with a credit union, and recently I went there to open up a new account. They suggested that I open up a "sub account", under my regular savings account. I went ahead and did that. How do I represent this sub account, under my regular savings account? It has the same account number, with a "-5" as a suffix. Rod In microsoft.public.money, Rod wrote: >I'm using Microsoft Money 2006 Premium. I've got a savings account with a >credit union, and recently I went there to open u...