Form does not display search resaults...

Petros

Registered User.
Local time
Today, 18:40
Joined
Jun 30, 2010
Messages
145
Hi all,
I use an unbound textbox in my application menu to search the content of some forms on the “click event” of a dedicated button. I use the below code, the continuous form opens but displays no results....also..how do i centre the text in the textbox? I do not use this code in the forms on load event since this form is globally used in the application.
Values. Alphanumeric
“AllAB” = query
[AB] = Combined .. [A] & "/" & in the “AllAB” query
Private Sub Button1_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "All"
If DCount("*", "AllAB", "[AB] like '*" & Me.Search & "*'") > 0 Then
DoCmd.OpenForm stDocName
Forms![All].Filter = "[AllAB]like '*" & Me.Search & "*'"
Forms![All].FilterOn = True
Else
MsgBox "No fruits found"
End If
End Sub
Any ideas why this code does not return any value in the continuous form “All”?
Thanks!
 
Change it to this:

Code:
[FONT=Calibri][SIZE=3]DoCmd.OpenForm stDocName, , , "[AllAB] like '*" & Me.Search & "*'"[/SIZE][/FONT]
And get rid of these two lines:

Forms![All].Filter = "[AllAB]like '*" & Me.Search & "*'"
Forms![All].FilterOn = True
 
Thank you boblarsson, however..something is wrong..the form opens but without any resaults...
 
strange..i moved the query and form to my front end, linked to my SQL..and it works just fine.

Thanks Again!
 
strange..i moved the query and form to my front end, linked to my SQL..and it works just fine.

Thanks Again!

Backends should only have tables. The frontend should have queries, forms, reports, macros, and modules.
 
I was unclear..i moved the query and form to the frontend of my database that is linked to the SQL... :-)
 

Users who are viewing this thread

Back
Top Bottom