By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,949 Members | 2,038 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,949 IT Pros & Developers. It's quick & easy.

Updating SubForm from ListBox

P: n/a
I have subform which uses a SQL statement as the record source.
One of the criteria (ie. Part of the WHERE condition) is a column value from
a ListBox on the MainForm.

Two problems exist:
1. When the MainForm opens, I get a "Enter Parameter Value" window, asking
me to input
the value it should be getting from the ListBox. (I suppose this is fair
enough, as the ListBox hasn't been
created/populated yet!)
2. When the ListBox is there, when I click on a row, I still get the "Enter
Parameter Value" window!
-I'm using a Requery when the row is clicked.
-A MsgBox within the OnClick event, is giving me the value that the SQL
statement should be using!
But the Subform doesn't seem to want to 'see' this value.

Any suggestions?

Thanks.

Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Instead of referring to the list box in the RowSource of your subform, you
could include the name of the list box in the LinkMasterFields or the
subform control. Then include the name of the matching subform field in the
LinkChildFields property.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Hey_Moe!" <mr**@bigpond.com> wrote in message
news:ci*********@mws-stat-syd.cdn.telstra.com.au...
I have subform which uses a SQL statement as the record source.
One of the criteria (ie. Part of the WHERE condition) is a column value
from
a ListBox on the MainForm.

Two problems exist:
1. When the MainForm opens, I get a "Enter Parameter Value" window,
asking
me to input
the value it should be getting from the ListBox. (I suppose this is fair
enough, as the ListBox hasn't been
created/populated yet!)
2. When the ListBox is there, when I click on a row, I still get the
"Enter
Parameter Value" window!
-I'm using a Requery when the row is clicked.
-A MsgBox within the OnClick event, is giving me the value that the SQL
statement should be using!
But the Subform doesn't seem to want to 'see' this value.

Nov 13 '05 #2

P: n/a

This is what I thought needed to be done, but here's what happens when I try
to use the Link Child & Link Master fields:
"Can't build a link between unbound forms".

I think the cause for this lies in the fact that the ListBox is unbound.
It gets populated in the OnLoad event for the MainForm using
'Me!List13.RowSource = "qry_Milestone_Register_04"'
(The database was designed and built by others. I've just recently inherited
it!)

I might need to bind the ListBox without the use of the OnLaod event.

Thanx.
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:41***********************@per-qv1-newsreader-01.iinet.net.au...
Instead of referring to the list box in the RowSource of your subform, you
could include the name of the list box in the LinkMasterFields or the
subform control. Then include the name of the matching subform field in the LinkChildFields property.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Hey_Moe!" <mr**@bigpond.com> wrote in message
news:ci*********@mws-stat-syd.cdn.telstra.com.au...
I have subform which uses a SQL statement as the record source.
One of the criteria (ie. Part of the WHERE condition) is a column value
from
a ListBox on the MainForm.

Two problems exist:
1. When the MainForm opens, I get a "Enter Parameter Value" window,
asking
me to input
the value it should be getting from the ListBox. (I suppose this is fair
enough, as the ListBox hasn't been
created/populated yet!)
2. When the ListBox is there, when I click on a row, I still get the
"Enter
Parameter Value" window!
-I'm using a Requery when the row is clicked.
-A MsgBox within the OnClick event, is giving me the value that the SQL
statement should be using!
But the Subform doesn't seem to want to 'see' this value.


Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.