Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I can't figure this one out....need

Status
Not open for further replies.

rocco

IS-IT--Management
Oct 30, 2001
106
CA
I can't figure this one out....need HELP!
Very interesting however as I thought it would work.

1. I have a main form (A) with a subform (B)
2. In the subform (B) I am clicking from a list created to open an other form with detail info form (C)

Problem: The variable is not passed and no results come across to form C.

However: If I test it from opening subform (B) that gives me a list and I click the number from the list, the value is passed and form (C) opens with the correct information. (I am using a query to select the single line and pass the info to form (C))

It is as if Form (A) does not know the values that the subform (B) has in order to pass the correct values.

Does anyone experience this and know how to pass the value from an inbedded subform to a 3rd form?

Thank you.....Alex
 
rocco,
Please provide the SQL of the record source as well as the form names. You can't simply use a criteria like:
SQL:
Forms!YourSubformName!YourControlName
You must drill down through the main form like:
SQL:
Forms!MainFormName!ctlYourSubformName!YourControlName


Duane
Hook'D on Access
MS Access MVP
 
I will supply the code...but that is what I am using. It is curious that it works from calling from one form to the other but not when the subform is used.
 
Sample that works...

SubFrm_Incident_InProgress
- Data - Qry_Incident_InProgress
(this will give me a list of incidents)

Field Incident_No found in SubFrm_Incident_InProgress List has and event - On Click - do this.
DoCmd.OpenForm "Frm_Incident_Detail_InProgress"
(I can click any line to pass the value)

Frm_Incident_Detail_InProgress
- Data - Qry_Incident_Selector_InProgress

Qry_Incident_Selector_InProgress
Under Field Incident_No - [Forms]![SubFrm_Incident_InProgress]![Incident_No]

***************************************************

This works great but it breaks down when I take SubFrm_Incident_InProgress FORM and drop it in an other form (MAIN) that has the links to other forms etc. I think that when I click my Incident_No action from any line it does not know that is coming from the SubFrm. The MAIN form on has the name of the sub that was dropped in and no detail of the sub elements. Any ideas of a workaround or diff method?
 
I told you why it didn't work since the subfrm_Incident_InProgress isn't really available unless you drill down through the name of the main form. It is no longer a form, it is a control on a form.

If your main form is named MAIN, the try criteria like:
Code:
 [Forms]!Main![SubFrm_Incident_InProgress]![Incident_No]
This will work if the name of your subform control on your main form is subfrm_incident_InProgress.

Duane
Hook'D on Access
MS Access MVP
 
ooh...Looking at the code for to long. Great news let me give it a try...and thank you for looking at the post.
 
Thank you for all your help dhookom...
It works like a charm and I was using a diff control name in the Main form which made things a little more confusing but all is good.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top