Help: Problem AFTER Search (1 Viewer)

tarcona

Registered User.
Local time
Today, 03:29
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?
 

ajetrumpet

Banned
Local time
Today, 03:29
Joined
Jun 22, 2007
Messages
5,638
my guess would be that the problem might lie in the strWHERE variable. The syntax may be off there.
 

JGT

Registered User.
Local time
Today, 05:29
Joined
Aug 19, 2008
Messages
49
I am somewhat suspicious about you changing the forms underlying data while you are in the subform as probably your subform is synchronized with the form. So it looks to me it could be that you are sawing off the branch where you are sitting on. At least I would expect some confusion.
 

Users who are viewing this thread

Top Bottom