Help: RecordSource Problem? (1 Viewer)

tarcona

Registered User.
Local time
Today, 05:03
Joined
Jun 3, 2008
Messages
165
Kind of confusing but here it goes:

The form is a search form with a subform. When I search through the subform...I change the RecordSource. When I search through the main form, I use a filter.

Well the problem arises after I do a search through the subform I can not search through the main form. I get my message box popping up stating there are no records, when in reality, there is a record.

Any suggestions?

I tried resetting the RecordSource to the original RecordSource, which is the "Accounts" table. I did this after I performed a search in the subform. This does do the job of showing all records, but still I can not search through the main form. It still displays that message.

My way around this is creating a Reset button that closes and opens the form for users to click after a search, but of course, I don't want users to have to do this. Any help or thoughts would be appreciated.

If this is any helpful...this is how I search for a record in the main form:

If DCount("Company", "Accounts", strWhere) <> 0 Then
Me.Filter = strWhere
Me.FilterOn = True
Else
MsgBox "Your search returned no results. Please check the spelling and try again.", vbInformation, "No Records"
End If

Do I have to change anything to this?
 
Last edited:

Users who are viewing this thread

Top Bottom