join operation. It NEEDS to work exactly as I said it does (by passing a
parameter embedded in an SQL string), but there just must be no way to do
that, so I'll go back to the drawing board.
I appreciate your willingness to help though.
:
From where does the query get the parameter's value if not from the user?
The parameter in your query appears to be one that requests the info from
the user. Will the value come from a variable in the code? If yes:
Dim strSQL As String
strSQL = "SELECT MAX(RecordID) FROM MyTable " & _
"WHERE CompanyID = " & NameOfTheVariable & ";"
--
Ken Snell
<MS ACCESS MVP>
Well, the idea is to bypass input from the user...no prompts whatsoever.
I
have a parameterized query, and I need to be able to pass the parameter in
the SQL string itself. I'm assuming this just can't be done.
Thanks for your reply!
John
:
One way to do it (assumes that CompanyID is a numeric format and not
text
format):
Dim strSQL As String
strSQL = "SELECT MAX(RecordID) FROM MyTable " & _
"WHERE CompanyID = " & InputBox("Which company number?") & ";"
--
Ken Snell
<MS ACCESS MVP>
Thanks for your reply!
Let me put this in concrete terms. Suppose I have a parameterized
query
that looks like this:
SELECT MAX(RecordID) FROM MyTable WHERE CompanyID = [Which company
number?];
How would I structure an SQL query to call this query passing the
CompanyID
in the SQL string? For what it's worth, the query above will