Parameter reference to a subform

G

Guest

I am using a form to input a parameter to a subform's controlsource (a query)
and have not been successful. I have searched the database without finding a
solution. My "master" form is called "Persons Table" and the subform is
named "ProjectsAllocations." The subform is on the 2nd Tab Control of this
set of forms and uses a query named, "ProjectAllocations" (note the suttle
difference in the word "Project" it is singular for the query). The code
from the parameter input form is as follows:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Forms![Persons Table]![ProjectsAllocations].Form"

DoCmd.OpenForm stDocName
DoCmd.OpenQuery "ProjectAllocations", acViewNormal, acAdd
DoCmd.OpenForm stDocName, , "ProjectAllocations", stLinkCriteria

DoCmd.Close acForm, "ContractNameSelect"
DoCmd.Close acQuery, "ProjectAllocations"

I have tried all kinds of variations of the reference to the column on the
subform where the data selected is input to the subform's query. I keep
getting an error that says the form referenece does not exist or is
misspelled.
 
G

Guest

Huey,

What is the criteria? In the code you dim a stLinkCriteria but you don't
assign it anywhere, but you do use it when opening the form...

Maurice
 

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