Parameter in a sql string for form



Hi,

I have a form such that when the user enters the date in the date
field it should show the top 3 dates equal to and less than the date
specified.
I am able to do this in a query but when I use that query as an SQL
string in my coding - it doesn't work -

....code..

sqlstring: select top3 date from frondmarkingtable where date <= "
&txtdate&" ;

this works fine as a query but in the code - nothing happens and no
dates are returned.

Please help.

.



Relevant Pages

  • Re: Need help with Code Please!!!
    ... posted in response to my last post was some SQL, but this is not the SQL that ... the actual string that gets built at the end of the SQ1 build process. ... The message says Syntax error in query expression ... Dim rs As Recordset 'object ref to qryCompany\USFNumber ...
    (microsoft.public.access.formscoding)
  • Re: Requery subform
    ... are just changing the SQL? ... remove this function and relevent code because the query always exists. ... Dim strProjectType As String ... Dim strProjectStatus As String ...
    (comp.databases.ms-access)
  • Re: Building SQL statement in VBA. Getting 3131 Runtime Error in FROM clause :@
    ... Number of characters in a cell in the query design grid 1,024 ... Since the SQL parser mentions an error in the FROM clause, ... The only problem I can see is the SQL string is very long. ... Dim qdf As QueryDef ...
    (microsoft.public.access.queries)
  • RE: Jet/Query editor destroys query...
    ... Oh, just to clarify, the auto-generated name for the sub-query was: ... Interestingly, my original SQL: ... within a double-quoted string literal. ... If I simply saved the query string (by directly assigning the string to the ...
    (microsoft.public.access.queries)
  • Re: Problems with Delete Command
    ... The SQL could get fairly messy if you need to construct it in code, ... ContactID, and WebComID, and create your on-the-fly SQL on that saved query, ... to find the list of ContactIDs from the junction table, ... This is a style/readability thing: if you are going to use string ...
    (microsoft.public.access.tablesdbdesign)