G
Gary Pollard
Access 97
I would like to open a form using a command button and automatically feed
the query a variable.
The form uses the following SQL as its record source
SELECT DISTINCTROW [PrePress-1].Docket, [PrePress-1].*, [PrePress-2].*,
[PrePress-3].*
FROM ([PrePress-1] LEFT JOIN [PrePress-2] ON [PrePress-1].Docket =
[PrePress-2].Docket) LEFT JOIN [PrePress-3] ON [PrePress-2].Docket =
[PrePress-3].Docket
WHERE ((([PrePress-1].Docket)=[EnterDocketNumber]));
This works if I manually open the form and supply a value for
[EnterDocketNumber]
I have tried the following but get error - "[PrePress-1.Docket]" isn't a
valid parameter name
stDocName = "PrePress"
stLinkCriteria = "[PrePress-1.Docket]=" & Me![Docket]
DoCmd.OpenForm stDocName, , , stLinkCriteria
How do automate this?
Any Help Appreciated
I would like to open a form using a command button and automatically feed
the query a variable.
The form uses the following SQL as its record source
SELECT DISTINCTROW [PrePress-1].Docket, [PrePress-1].*, [PrePress-2].*,
[PrePress-3].*
FROM ([PrePress-1] LEFT JOIN [PrePress-2] ON [PrePress-1].Docket =
[PrePress-2].Docket) LEFT JOIN [PrePress-3] ON [PrePress-2].Docket =
[PrePress-3].Docket
WHERE ((([PrePress-1].Docket)=[EnterDocketNumber]));
This works if I manually open the form and supply a value for
[EnterDocketNumber]
I have tried the following but get error - "[PrePress-1.Docket]" isn't a
valid parameter name
stDocName = "PrePress"
stLinkCriteria = "[PrePress-1.Docket]=" & Me![Docket]
DoCmd.OpenForm stDocName, , , stLinkCriteria
How do automate this?
Any Help Appreciated