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

Getting a parameter value from a form

Status
Not open for further replies.

Board2Death

Technical User
Apr 27, 2005
88
US
I have a query whereby I would like to get a parameter value from a form.

I created a function called getInfo that returns a string value the is in a textbox on the form.

In the info column of the query I put the following into the criteria field:

getInfo()

The function should look something like this:

Public Function getInfo() As String
DoCmd.OpenForm "getInfo", , , , , acDialog
getDANATest = ????
End Function


Question 1: Why does the form not display?
Question 2:How do I return the value in txbName from the form?
 
Since the query is looking for a CRITERIA, not a function that kicks off a form, it will not work. You have to already have the form open for the query to see the criteria from it.

With the form open, you can refence the field, and from your info above, I am assuming it is txbName; in the following manner:

Code:
 [Forms]![FormName]![FieldName
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top