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

Pass a List Box Value to a Sub Form

P: n/a
I have a form (frmReport) with a list box (lstFileName) and a sub form
that are not directly related, but I want to be able to store the
value from the list box in one of the fields of the sub form.

The listbox is "lstFileName".

In the sub form field's after update property, I am trying to get the
listbox value from the main form

strReportNo = Me.Form.frmReport.Form.lstFileName.Column(1)

then assign the value of the strReportNo variable to the sub form
field.

has anyone ever done this before and could provide some guidance?

Sep 18 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Use the Parent property to access info on the main form. In your subform's
code:

Me.NameOfFieldToGetValue.Value = Me.Parent.Form.lstFileName.Column(1)

--

Ken Snell
<MS ACCESS MVP>
"ToddM326" <tj*****@adelphia.netwrote in message
news:11**********************@q5g2000prf.googlegro ups.com...
>I have a form (frmReport) with a list box (lstFileName) and a sub form
that are not directly related, but I want to be able to store the
value from the list box in one of the fields of the sub form.

The listbox is "lstFileName".

In the sub form field's after update property, I am trying to get the
listbox value from the main form

strReportNo = Me.Form.frmReport.Form.lstFileName.Column(1)

then assign the value of the strReportNo variable to the sub form
field.

has anyone ever done this before and could provide some guidance?

Sep 18 '07 #2

P: n/a
On Sep 18, 11:46 am, "Ken Snell" <kthsneisll...@ncoomcastt.renaetl>
wrote:
Use the Parent property to access info on the main form. In your subform's
code:

Me.NameOfFieldToGetValue.Value = Me.Parent.Form.lstFileName.Column(1)

--

Ken Snell
<MS ACCESS MVP>

"ToddM326" <tjmo...@adelphia.netwrote in message

news:11**********************@q5g2000prf.googlegro ups.com...
I have a form (frmReport) with a list box (lstFileName) and a sub form
that are not directly related, but I want to be able to store the
value from the list box in one of the fields of the sub form.
The listbox is "lstFileName".
In the sub form field's after update property, I am trying to get the
listbox value from the main form
strReportNo = Me.Form.frmReport.Form.lstFileName.Column(1)
then assign the value of the strReportNo variable to the sub form
field.
has anyone ever done this before and could provide some guidance?- Hide quoted text -

- Show quoted text -
Thank you. That did the trick!

Sep 18 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.