473,320 Members | 1,957 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Pass a List Box Value to a Sub Form

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
2 12062
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mark | last post by:
Hi - I have a dynamically created table, which has a number of forms - each named consecutively as 'adduserX' where X is a number generated from ASP. Within each form, I need to have a button...
3
by: Nath | last post by:
Please help!? I am new to writing html, javascript, pretty new to MySQL but quite proficient at writing Perl and i'm a quick learner. I am building a database driven website and i am a little...
4
by: Fred | last post by:
Hi, i know how to pass a value from Javascript to ASP with a hidden field into a form and submitting it, or with cookies, but here i have to pass a lot of data in an array. There is a list of...
4
by: Dan | last post by:
Can anyone offer suggestions on how to do this or if it is possible? I have a form that uses a drop down box and 2 text fields. What I am trying to do is have the value of each text box set by...
15
by: Jack | last post by:
Hi, I have a asp form where one element is a list box which lists four years starting from 2004. This list is drawn from a database table which has YearID and Year as two fields as shown below:...
17
by: Rabbit | last post by:
Hi, On my 1st page, i have a function which gets a new ID value and need to transfer to another immediately. which I want to get in 2nd page using Request.form("txtID"), but doesn't work, the...
19
Atli
by: Atli | last post by:
Introduction At some point, all web developers will need to collect data from their users. In a dynamic web page, everything revolves around the users input, so knowing how to ask for and collect...
1
by: Arpit Nagar | last post by:
Hi... I am creating a dummy project for collage. Here I had choosen my project as Jewelleryshoping. Now the scenerio is like that thier are jewellry item which I had display in table format with...
9
by: JRough | last post by:
I tried to pass the $result from a mysql_query in a url like this line Header("Location:clm_historyXL.php?_result=".$result); but on the redirect location clm_history.php page I get an error on...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.