Re: Programmatic SQL statement

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: George Papadopoulos (divined2002_at_freemail.gr)
Date: 03/11/04


Date: Thu, 11 Mar 2004 08:46:46 +0200

thx, Dan

  I needed to add those quotes after all.

George Papadopoulos

Ο "dan artuso" <dan.artuso@NOSPAMnrc.ca> έγραψε στο μήνυμα
news:em7bsupBEHA.3568@tk2msftngp13.phx.gbl...
> Hi,
> If it's text, you have to enclose it in quotes:
> Kwdikos_mhxanhmatos FROM EPISKEYH WHERE Kwdikos_texnikou ='" & _
> Me.Kwdikos_Texnikou & "'"
>
> If the value is numeric, you don't need delimiters and if it's a date, you
> delimit with #.
>
> HTH
> Dan Artuso, MVP
>
> "George Papadopoulos" <divined2002@freemail.gr> wrote in message
> news:#44tOdpBEHA.624@TK2MSFTNGP10.phx.gbl...
> > Hello everybody
> >
> > I have written the code below :
> >
> > Private Sub Anazhthsh_Click()
> > Dim strSelect As String
> >
> > strSelect = "Select Kwdikos_episkeyhs, Kwdikos_klinikhs,
> > Kwdikos_mhxanhmatos FROM EPISKEYH WHERE Kwdikos_texnikou =" &
> > Me.Kwdikos_Texnikou.Value
> >
> > MsgBox (Me.Kwdikos_Texnikou.Value)
> >
> > [list_Episkeyes].RowSource = strSelect
> >
> > End Sub
> >
> > Table EPISKEYH contains a text field of length 4, named
Kwdikos_texnikou.
> > Me.Kwdikos_texnikou.Value is supposed to be the value of a text box on
my
> > form, inputed by the user.
> >
> > The statement [list.Episkeyes].RowSource = strSelect does not select
any
> > records (list_Episkeyes is a list box).
> >
> > What am I doing wrong? Do I need to cast the value of the text box
into
> > 'text' type. Or something else?
> >
> > Any help would be appreciated.
> >
> > George Papadopoulos
> >
> >
>
>


Quantcast