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

Searching on subforms

Status
Not open for further replies.

auger

Technical User
Oct 27, 2001
48
CA
I have a form containing several subforms that are displayed as forms (not datasheets).

I can't search any of the subform fields and return results. Am I missing something? Is it possible to search fields on the subforms and return results and if so, how would I go about achieving that?

Thanks in advance.
 
Try putting the form in design view, use a combo box from the toolbox(the wizard button should be on), the wizard will ask you which form and fields you want to lookup.(I hope this works, if not reply please!).
Good luck!
 
Here is sample for searching data on subform by using combobox:

private sub cboComboBox_AfterUpdate()
dim rst as recordset

set rst=me.subFormName.form.recordsetclone
rst.findfirst "MyFieldName = " & me.cboComboBox 'Use valid separator for different data types, e.g.
"MyFieldName = '" & me.cboComboBox & "'" for text type and # for date type

if not rst.NoMatch then
me.subFormName.form.bookmark=rst.bookmark
else
msgbox "No data blablabla...."
end if
rst.close
set rst=nothing
end sub


Aivars |-0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top