codeWarrior456
Technical User
I would like to know if there is a way to store a value in a variable using an SQL statement. If so, how is this done?
Here is an example of what I am trying to do. I have a database that is taking care of video rentals. Before the computer processes the order I want it to check the status of the video to make sure that it is not marked as checked out. I want to store this status in a variable but do not know how. I tried the following:
DoCmd.RunSQL ("SELECT [Branch Inventory].Status INTO strStatus FROM [Branch Inventory] WHERE VidNum = '1';"
However, instead of getting the value I want stored in a variable what happens is a table named strStatus is created containing the value that I was looking for. How do I fix this.
Thanks in advance.
Here is an example of what I am trying to do. I have a database that is taking care of video rentals. Before the computer processes the order I want it to check the status of the video to make sure that it is not marked as checked out. I want to store this status in a variable but do not know how. I tried the following:
DoCmd.RunSQL ("SELECT [Branch Inventory].Status INTO strStatus FROM [Branch Inventory] WHERE VidNum = '1';"
However, instead of getting the value I want stored in a variable what happens is a table named strStatus is created containing the value that I was looking for. How do I fix this.
Thanks in advance.