OldManRiver
Registered User.
- Local time
- Today, 04:09
- Joined
- Jan 29, 2009
- Messages
- 49
All,
The normal use for this command is for and existing query.
I have an Append (table building) query "qryBLDfnr" and need to mod it for filtering by date with:
Since it is an Append query the DoCmd.RunSQL will not work and with the SQL string I get errors.
I know somehow I need to assign this to an object, based on the error message of:
Have not found any help in the HOWTOs.
Thanks!
OMR
The normal use for this command is for and existing query.
I have an Append (table building) query "qryBLDfnr" and need to mod it for filtering by date with:
Code:
Sub Sav_Tmp(MyTable)
' Save values to the Temp Table
Dim DATbeg, DATend, SQLstr, WHRstr
DATbeg = TargetForm![tboxSDT]
DATend = TargetForm![tboxEDT]
WHRstr = "WHERE (([tmp_wdt] <= DateSerial(Year(DATbeg), Month(DATbeg), Day(DATbeg))) AND " & _
"([tmp_wdt] >= DateSerial(Year(DATend), Month(DATend), Day(DATend))));"
SQLstr = "SELECT * FROM qryBLDfnr " & WHRstr
DoCmd.SetWarnings False
DoCmd.OpenQuery SQLstr
DoCmd.SetWarnings True
End Sub
I know somehow I need to assign this to an object, based on the error message of:
But do not know which object type, or syntax.Run-time error '7874':
Microsoft Office Access can't find the object 'SELECT * FROM qryBLDfnr WHERE (([tmp_wdt] <= DateSerial(Year(DATbeg), Month(DATbeg), Day(DATbeg))) AND ([tmp_wdt] >= DateSerial(Year(DATend), Month(DATend), Day(DATend))));.'
Have not found any help in the HOWTOs.
Thanks!
OMR