access: passing variables from vba to sql

Posted by every_answer_gets_a_point on Stack Overflow See other posts from Stack Overflow or by every_answer_gets_a_point
Published on 2010-05-16T14:21:09Z Indexed on 2010/05/16 14:30 UTC
Read the original article Hit count: 179

Filed under:
|
|
|

i am clicking a button on a form in access:

Private Sub Command29_Click()
some_variable = 2
stDocName = "test"
DoCmd.OpenQuery stDocName
End Sub

my query looks like this:

SELECT *
FROM [some_table]
WHERE [Occurrence Number]=some_variable;

is this possible to do?

© Stack Overflow or respective owner

Related posts about access

Related posts about sql