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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Parameters in access

Status
Not open for further replies.

goldygirl

Programmer
Jan 16, 2004
33
US
I have an issue with a passing arguments in Access. Here is a problem description.
I have Form1 and Form2 . Form2 calls Forms2 and pass 2 arguments. Both forms were aerated with access wizard.

Attached is VBA code:

stDocName = "Offer USA"
stLinkCriteria = "[Dtl_ID]=" & Me![Promo] & " And [Dtl_Name]=" & Me![Text18]
DoCmd.OpenForm stDocName, , , stLinkCriteria

The problem is that I am getting a window where I have to manually enter the second argument.
Any ideas how to get rid off the parameter window??

Thank you ?)
 
Is it possible that since creating the stLinkCriteria you have changed the name of Text18 to something more descriptive?

 
NO:(( I checked all the name... It is Text18 :(( Any other sugestions???
 
Possibly adding a trailing "" to the end of the stLinkCriteria.
Code:
stLinkCriteria = "[Dtl_ID]=" & Me![Promo] & " And [Dtl_Name]=" & Me![Text18]
""
 
I think it is invalid sintax. I am getting compile error (Expected:end of statement) :(((
 
Dear ethorn10,

I forgot to mention that Text18 bound to one of the fields in subform...
 
Hi goldygirl!

basically your syntax is correct, except for one tiny thing:
since [Dtl_Name] very obviously is a text field, you must surround the value with quotes:

stDocName = "Offer USA"
stLinkCriteria = "[Dtl_ID]=" & Me![Promo] & " And [Dtl_Name]='" & Me![Text18] & "' "
DoCmd.OpenForm stDocName, , , stLinkCriteria

This should already do it
;-)
 
Dear MakeItSo

YES :))) It worked :))

Thanks you for your help:))))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top