Hi again
Over the past 18 months or so I have been gradually developing Access/VBA skills, all of which have been self taught or with a lot of help from this forum!
I am now at a stage where I would like to be able to write SQL statements but am struggling a bit. My main issue seems to be with syntax!
I have looked at Google examples and have also looked at the SQL behind queries but to not seem to be able to convert that successfully.
In my application, I have a number of update queries, but it seems to me that writing an SQL statement would be simpler and cleaner so I am keen to embark on learning this side of development.
Rather than create an update query I would like to write a statement that updates a field in a table based on, for example:
Table: "tblStock"
Field to update: "Active" (Yes or No)
Criteria: "StockNumber" in table = "StockNo" (A variable, integer, in my on click event)
So, I am trying to end up with is something like:
Update Field "Active" in Table "tblStock" where "Stocknumber = myVariable "StockNo"".
I would appreciate any assistance how to write this in VBA including Dim statements and DoCmd options to run the SQL to achieve this.
Hope this make sense!
Many thanks
David
Over the past 18 months or so I have been gradually developing Access/VBA skills, all of which have been self taught or with a lot of help from this forum!
I am now at a stage where I would like to be able to write SQL statements but am struggling a bit. My main issue seems to be with syntax!
I have looked at Google examples and have also looked at the SQL behind queries but to not seem to be able to convert that successfully.
In my application, I have a number of update queries, but it seems to me that writing an SQL statement would be simpler and cleaner so I am keen to embark on learning this side of development.
Rather than create an update query I would like to write a statement that updates a field in a table based on, for example:
Table: "tblStock"
Field to update: "Active" (Yes or No)
Criteria: "StockNumber" in table = "StockNo" (A variable, integer, in my on click event)
So, I am trying to end up with is something like:
Update Field "Active" in Table "tblStock" where "Stocknumber = myVariable "StockNo"".
I would appreciate any assistance how to write this in VBA including Dim statements and DoCmd options to run the SQL to achieve this.
Hope this make sense!
Many thanks
David