Pass A Value From Subform

S

ScottS

Hello all,

I have form that allows users to select a date range and store number from
combo boxes. After accepting this critera a subform displays the sales
grouped by salesperson. I would like to have the capability to select a
record off the subform and pass values to my code to enable the display
another subform with the items that salesperson sold.

Question is it possible to access values from a record selected in a
subform? If so, how?

I also thought of displaying the highlevel sales in a list box instead then
I could pass along the key to the record selected to the next subform.
 
D

Daniel

You can access the info on subforms. The basic synthax is

Forms![FormName]![SubformName]![...]![SubfromName!].Form.[ControlName]

Daniel P
 
D

Douglas J. Steele

Actually, it's

Forms![FormName]![SubformControlName].Forrm![...]![SubformControlName!].Form.[ControlName]

Note that depending on how the subform was added to the parent form, the
name of the subform control on the parent form ([SubformControlName]) may
not be the same as the name of the form being used as a subform. It's the
name of the subform control you want (which is why you always need the .Form
property in order to refer to controls on the subform)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Daniel said:
You can access the info on subforms. The basic synthax is

Forms![FormName]![SubformName]![...]![SubfromName!].Form.[ControlName]

Daniel P







ScottS said:
Hello all,

I have form that allows users to select a date range and store number
from
combo boxes. After accepting this critera a subform displays the sales
grouped by salesperson. I would like to have the capability to select a
record off the subform and pass values to my code to enable the display
another subform with the items that salesperson sold.

Question is it possible to access values from a record selected in a
subform? If so, how?

I also thought of displaying the highlevel sales in a list box instead
then
I could pass along the key to the record selected to the next subform.
 
S

ScottS

Thanks for the quick replies on this! I
--
Scott S


Douglas J. Steele said:
Actually, it's

Forms![FormName]![SubformControlName].Forrm![...]![SubformControlName!].Form.[ControlName]

Note that depending on how the subform was added to the parent form, the
name of the subform control on the parent form ([SubformControlName]) may
not be the same as the name of the form being used as a subform. It's the
name of the subform control you want (which is why you always need the .Form
property in order to refer to controls on the subform)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Daniel said:
You can access the info on subforms. The basic synthax is

Forms![FormName]![SubformName]![...]![SubfromName!].Form.[ControlName]

Daniel P







ScottS said:
Hello all,

I have form that allows users to select a date range and store number
from
combo boxes. After accepting this critera a subform displays the sales
grouped by salesperson. I would like to have the capability to select a
record off the subform and pass values to my code to enable the display
another subform with the items that salesperson sold.

Question is it possible to access values from a record selected in a
subform? If so, how?

I also thought of displaying the highlevel sales in a list box instead
then
I could pass along the key to the record selected to the next subform.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top