Full Version: help with search form
UtterAccess Forums > Microsoft® Access > Access Forms
rsbutterfly16
hi guys i hope you can help me. i have a search form that uses a query to return a datasheet according to what the user inputs in the text box.
My query is as follows:
SELECT tblMain.ID, tblMain.Distributor, tblMain.LastDelivery
WHERE (((tblMain.Distributor) Like [forms]![DistributorSearchMain].[txtDistributorName] & "*"). this query runs everytime the user presses the command "search" in my form.
when i use the form by itself it works perfectly; however i need to put this form as a subform. when i do this, when i press the command button but i get the message to enter parameter value [forms]![DistributorSearchMain].[txtDistributorName] . I am not sure why this is happening... any ideas?
Jack Cowley
You need to refer to the subform:
Forms]![DistributorSearchMain]![SubformName].Form.txtDistributorName
Give that a shot and see if it fixes the problem...
hth,
Jack
rsbutterfly16
same error but now i get enter paramater and
Forms]![DistributorSearchMain]![SubformName].Form.txtDistributorName
Jack Cowley
In this line of code:
Forms]![DistributorSearchMain]![SubformName].Form.txtDistributorName
Replace SubformName with the actual name of your subform CONTROL (the actual subform name may not be the same as the subform CONTROL name so be sure you use the right one). Remember, a subform is just another control on a form and it will have a name so click once on the subform control, when in design view of your main form, and look at the name in the Name property (under the Other tab).
hth,
Jack
rsbutterfly16
it worked thank you so much!!!
Jack Cowley
YEEHAA! You are most welcome....
ack
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.