Gasman
Enthusiastic Amateur
- Local time
- Today, 22:39
- Joined
- Sep 21, 2011
- Messages
- 16,668
Helping someone on another forum, the query below did not work?
I did manage to get it to work using a Tempvar, then discovered that if I used
the query worked?
I also did have issues when trying to assign the control value to a TempVar, stating they could not contain objects. Used the .Value property on each.
So it appears that the default property was not being used for the control? Specifically using .Value worked?
Edit: Ok, I forgot the Tempvar assignment must have the .Value property of a control, but AFAIK the posters original code should have worked?
I have similar in some code of mine, just that I use a TempVar from an InputBox.
Just tried a new query and that also worked fine?
Went back to that DB and removed the .Value property and now that works?
Go figure.
Code:
SELECT ItemT.ItemDescription, ItemT.Brand, ItemT.Model, ItemT.SerialNumber, ItemT.Size, ItemT.Color, ItemT.Dealer, ItemT.Category, ItemT.Room, ItemT.Cost, ItemT.Tax, ItemT.ReplValue, ItemT.FacWarrEXP, ItemT.ExtWarrEXP, ItemT.PurchaseDate
FROM ItemT
WHERE (((ItemT.Model) Like "*" & [Forms]![MainMenuF]![SearchBox] & "*"));
I did manage to get it to work using a Tempvar, then discovered that if I used
Code:
SELECT ItemT.ItemDescription, ItemT.Brand, ItemT.Model, ItemT.SerialNumber, ItemT.Size, ItemT.Color, ItemT.Dealer, ItemT.Category, ItemT.Room, ItemT.Cost, ItemT.Tax, ItemT.ReplValue, ItemT.FacWarrEXP, ItemT.ExtWarrEXP, ItemT.PurchaseDate
FROM ItemT
WHERE (((ItemT.Model) Like "*" & [Forms]![MainMenuF]![SearchBox].Value & "*"));
the query worked?
I also did have issues when trying to assign the control value to a TempVar, stating they could not contain objects. Used the .Value property on each.
So it appears that the default property was not being used for the control? Specifically using .Value worked?
Edit: Ok, I forgot the Tempvar assignment must have the .Value property of a control, but AFAIK the posters original code should have worked?
I have similar in some code of mine, just that I use a TempVar from an InputBox.
Just tried a new query and that also worked fine?
Code:
SELECT tblFoods.*, tblFoods.FoodID
FROM tblFoods
WHERE (((tblFoods.FoodID) Like "*" & [Forms]![frmDailyEntry]![sfcsfrmDaily].[Form]![cboFoodIDFK]& "*"));
Went back to that DB and removed the .Value property and now that works?

Go figure.

Last edited: