SQL Pass-thru query

  • Thread starter Thread starter Eva Shanley
  • Start date Start date
E

Eva Shanley

Can you include a prompt for a date in a pass-thru query,
and if so how do you code it? Thanks!
 
Speaking of 'code it' why not do it all in code?

Private Sub Command0_Click()
Dim strInput as string
strInput=InputBox("Whatever prompt")
'Error check input here, IsDate, IsNull, IsNumeric...
DoCmd.RunSQL "INSERT ... WHERE [x]='" & strInput & "'" , -1
End Sub

The -1 tells it to make the query a pass-through.

-Cameron Sutherland
 
Not sure where you got that information but the -1 makes the query
transactional.
I create a standard pass-through and then use DAO code to change the SQL of
the QueryDef. This allows you to create any legitimate SQL statement and
assign it to an existing P-T.

--
Duane Hookom
MS Access MVP


Cameron Sutherland said:
Speaking of 'code it' why not do it all in code?

Private Sub Command0_Click()
Dim strInput as string
strInput=InputBox("Whatever prompt")
'Error check input here, IsDate, IsNull, IsNumeric...
DoCmd.RunSQL "INSERT ... WHERE [x]='" & strInput & "'" , -1
End Sub

The -1 tells it to make the query a pass-through.

-Cameron Sutherland
-----Original Message-----
Can you include a prompt for a date in a pass-thru query,
and if so how do you code it? Thanks!
.
 
Back
Top