Hello!!
I have a little problem with my database (I'm new on this Software).
I created a Table "Inventory" with this fields:
- Platform
- Title
- Edition
- Barcode
- Contents
- Language
Then, one form "Search" with a Search button that open another form "Results".
The purpose of the Search form is to find results into the Table and show them into the Form "Results".
I need that it can find results even if I set just one field (like Title) and even if the field is not exactly the same of the one inside the same in the Table (ex. "ho" or "ou" instead "House").
The Database works with this:
Code:
SetTempVAr
Name ProvaPlat
Expression = [Forms]![Search]![SelPlat]
SetTempVAr
Name ProvaTitle
Expression = [Forms]![Search]![SelTitle]
SetTempVAr
Name ProvaEd
Expression = [Forms]![Search]![SelPlat]
SetTempVAr
Name ProvaPlat
Expression = [Forms]![Search]![SelEd]
SetTempVAr
Name ProvaBar
Expression = [Forms]![Search]![SelBar]
SetTempVAr
Name ProvaCont
Expression = [Forms]![Search]![SelCont]
SetTempVAr
Name ProvaLang
Expression = [Forms]![Search]![SelLang]
OpenForm
Form Name Results
View Form
Filter Name
Where Condition = ([Platform]=[TempVars]![ProvaPlat]) And ([Title]=[TempVars]![ProvaTitle]) And ([Edition]=[TempVars]![ProvaEdit]) And ([Barcode]=[TempVars]![ProvaBar]) And _
([Contents]=[TempVars]![ProvaCont]) And ([Language]=[TempVars]![ProvaLang])
Data Mode Read Only
Window Mode Normal
ApplyFilter
Filter Name Filter 1
Where Condition = ([Platform] Like "*" & [TempVars]![ProvaPlat] & "*")
Control Name
The problem is that the Where Condition has just 255 digits available.
I tried to code it with SQL (Access VBA) like this:
Code:
Private Sub Search_Click()
Dim ProvaPlat As TempVars
Dim ProvaTitle As TempVars
Dim ProvaEdit As TempVars
Dim ProvaBar As TempVars
Dim ProvaCont As TempVars
Dim ProvaLang As TempVars
TempVars!ProvaPlat = Me.Platform.Value
TempVars!ProvaTitle = Me.Title.Value
TempVars!ProvaEdit = Me.Edition.Value
TempVars!ProvaBar = Me.Barcode.Value
TempVars!ProvaCont = Me.Contents.Value
TempVars!ProvaLang = Me.Language.Value
Me.Filter = ("[Platform] Like" & "*" & Me.SelPlat & "*") And ("[Title] Like" & "*" & Me.SelTitle & "*") And ("[Edition] Like" & "*" & Me.SelEd & "*") And ("[Barcode] Like" & "*" & Me.SelBar & "*") And _
("[Contents] Like" & "*" & Me.SelCont & "*") And ("[Language] Like" & "*" & Me.SelLang & "*")
DoCmd.OpenForm "Results", , , "([Platform]=[TempVars]![ProvaPlat]) And ([Title]=[TempVars]![ProvaTitle]) And ([Edition]=[TempVars]![ProvaEdit]) And ([Contents]=[TempVars]![ProvaCont]) And ([Barcode]=[TempVars]![ProvaBar]) And ([Language]=[TempVars]![ProvaLang])"
The problem, here, is that the Form find the results if you fill all the fields with the exactly same digits inside the item in the Inventory Table.
I want to fill just one or two field and with a partial text (like, as I said, "ho" instead of "House" in the field "Title").
There is anyone that can help me?
Thank you a lot for your time and attention
Dermir