Reputation: 57
I have example table like below
| ID | Qty |
| -- | ----|
| 1 | 5 |
| 2 | 7 |
| 3 | 8 |
| 4 | 9 |
| 5 | 12 |
How can I pass result of below query into VBA variable to use in next queries (update and insert)?
SELECT example_tab.Qty
FROM example_tab
WHERE ID = 4
In example that test_variable = 9
Upvotes: 0
Views: 213
Reputation: 608
Is this what your looking for ?
sSQL = "SELECT example_tab.Qty FROM example_tab WHERE ID = 4"
Dim rs As DAO.Recordset
Set rs = CurrentDB.OpenRecordset(sSQL)
Upvotes: 0