Problem with SQL statement

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dwadish
    New Member
    • Nov 2006
    • 129

    #1

    Problem with SQL statement

    Hai buddies i am razak .

    dim strsql as string

    strsql="select * from diary where da=#" & dtpicker1.value &"# and code=" & text1.text
    set rs=db.openrecor dset("strsql",d bopensnapshot)
    if rs.bof and rs.eof then exit sub
    text2.text=rs.f ields(3)
    rs.close

    it have an error [ jet db strsql is nothing check the spelling etc]

    i am already set the db source from form load()

    here the "diary" is the table name


    plz help me guys !!!

    Thanx in advance..
  • willakawill
    Top Contributor
    • Oct 2006
    • 1646

    #2
    Originally posted by dwadish
    Hai buddies i am razak .

    dim strsql as string

    strsql="select * from diary where da=#" & dtpicker1.value &"# and code=" & text1.text
    set rs=db.openrecor dset("strsql",d bopensnapshot)
    if rs.bof and rs.eof then exit sub
    text2.text=rs.f ields(3)
    rs.close

    it have an error [ jet db strsql is nothing check the spelling etc]

    i am already set the db source from form load()

    here the "diary" is the table name


    plz help me guys !!!

    Thanx in advance..
    Hi. Happy Holidays :)

    change this
    Code:
    set rs=db.openrecordset("strsql",dbopensnapshot)
    to this
    Code:
    set rs=db.openrecordset(strsql,dbopensnapshot)

    Comment

    • dwadish
      New Member
      • Nov 2006
      • 129

      #3
      Originally posted by willakawill
      Hi. Happy Holidays :)

      change this
      Code:
      set rs=db.openrecordset("strsql",dbopensnapshot)
      to this
      Code:
      set rs=db.openrecordset(strsql,dbopensnapshot)
      thanx and it helped me to proceed

      Comment

      • willakawill
        Top Contributor
        • Oct 2006
        • 1646

        #4
        Originally posted by dwadish
        thanx and it helped me to proceed
        You are very welcome

        Comment

        Working...