I have a form (frmFindCategory) with 2 objects. Object 1 is a combo box (cboFoodCategory) and Object 2 is a Command Button (cmdFindRecord). The cboFoodCategory uses a Select Query (SELECT [Categories].[CategoryID], [Categories].[Category] FROM Categories ORDER BY [Category]; to get the values from which a user can choose. The cmdFindRecord should save that choice to a temporary variable CurrentCategory.
In the event tab for cmdFindRecord I have a Macro built like this:
When I select the Value in cboFoodCategory object and then click the Find Button, I get the Message box but instead of getting the selected category I get the message Temporary Variable CurrentCategory is set to: " & [TempVars]![CurrentCategory] & "." in the message box.Code:If Not IsNull([cboFoodCategory]) Then SetTempVar Name CurrentCategory Expression =[cboFoodCategory] MessageBox Message "Temporary Variable CurrentCategory is set to: " & [TempVars]![CurrentCategory] & "." Beep Yes Type Information Title End IF
Does that mean the Temporary Variable CurrentCategory was not set? Or do I have something wrong in my coding?