By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,476 Members | 1,376 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,476 IT Pros & Developers. It's quick & easy.

Cross form search

Kaosu
P: 19
I would like to know how to do a search in a text box on Form X that closes Form X and opens Form Y and looks for the information in Y.

The search works perfectly when preformed while on Form Y. The search box is identical on both X and Y, its just getting X to point at Y when executing this command.

Expand|Select|Wrap|Line Numbers
  1.     Dim strFilter As String
  2.     strFilter = ""
  3.     If IsNull(Me!fnSRH) Then
  4.         strFilter = strFilter
  5.     Else
  6.         If strFilter = "" Then
  7.             strFilter = strFilter & "FullName Like '*" & Me!fnSRH & "*'"
  8.         Else
  9.             strFilter = strFilter & " AND FullName Like '*" & Me!fnSRH & "*'"
  10.  
  11.     End If
  12.     End If
  13.  
  14.     Me.Filter = strFilter
  15.     Me.FilterOn = True
  16.     Me!fnSRH = Null
  17.  
Jun 5 '08 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 344
Not 100% certain what you are trying to do, but this may help.

At the end of your code you say me.filter=strFilter. I assume you want this on Form X.

so try this.

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm "formy", , , , , , strFilter
  2.  
  3.  
and then in FormY OnOpen event
Expand|Select|Wrap|Line Numbers
  1. DoCmd.Close acForm, "FormX"
  2. me.filter=openargs
  3.  
  4.  
Jun 5 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.