Show All Records (1 Viewer)

tarcona

Registered User.
Local time
Today, 03:45
Joined
Jun 3, 2008
Messages
165
Hi, I can not search in my mainform after I do a search in my subform. After I perform a search in the subform and I try to search the mainform, I get a no records message box that I created because it can't find any matches EVEN THOUGH there are matches.

To solve this I have a reset button that closes and opens the form. That easy. But I kind of dont want to close and open the form. I just want to reset the search to SHOW ALL RECORDS.

I found one way to do this my re-establishing my RecordSource and that works...that shows all of the records again. But I still can not perform a successful search through the main form.

Any suggestions? I appreciate your help in advance.
 

maxmangion

AWF VIP
Local time
Today, 09:45
Joined
Feb 26, 2003
Messages
2,805
when you perform the search on the subform is your mainform being filtered and displays only that record? If yes you need to remove the filter before performing a new search.
 

tarcona

Registered User.
Local time
Today, 03:45
Joined
Jun 3, 2008
Messages
165
I tried putting:

Me.FilterOn = False

but that does not work.
 

tarcona

Registered User.
Local time
Today, 03:45
Joined
Jun 3, 2008
Messages
165
Ha. That works if I filter the main form. But does not work if I filter the subform. To filter the subform I am changing the RecordSource.
 

tarcona

Registered User.
Local time
Today, 03:45
Joined
Jun 3, 2008
Messages
165
I just dont get it. I have 1175 records. When I use Me.RecordSource = "Accounts" after I perform a search, the record count goes back to 1175. But then when I try to search through the main form, it can't find any records...
 

maxmangion

AWF VIP
Local time
Today, 09:45
Joined
Feb 26, 2003
Messages
2,805
are you placing the focus back on the mainform before performing the new search?
 

tarcona

Registered User.
Local time
Today, 03:45
Joined
Jun 3, 2008
Messages
165
Nope, how is that done?

Forms![FORMNAME].SetFocus

Like that?
 

tarcona

Registered User.
Local time
Today, 03:45
Joined
Jun 3, 2008
Messages
165
Ok I am getting an error message box saying:

Run-time error 2452

The expression you entered has an invalid reference to the Parent property.
 

maxmangion

AWF VIP
Local time
Today, 09:45
Joined
Feb 26, 2003
Messages
2,805
How about trying:

Me.Parent!ControlName.SetFocus

where controlname would be a control on the mainform
 

Users who are viewing this thread

Top Bottom