Re: Checking control properties

From: Stephen Glynn (stephen.glynn_at_ntlworld.com)
Date: 06/20/04

  • Next message: MacDermott: "Re: Checking control properties"
    Date: Sun, 20 Jun 2004 18:06:22 +0100
    
    

    It works! Thanks so much for your help.

    Would you mind explaining the VB syntax to me (told you I was a baby at
    this)? I understand the SQL but the ampersands and quote marks (single
    and double) get me very confused.

    Steve

    MacDermott wrote:

    > Try it like this:
    >
    > currentdb.execute "INSERT INTO tblTemp (ControlName," & _
    > " ControlTag) VALUES ('" & _
    > ctl.Name & "','" & ctl.tag & "')"
    >
    > HTH
    > - Turtle
    >
    >
    > "Stephen Glynn" <stephen.glynn@ntlworld.com> wrote in message
    > news:2jl4ndF12kdcmU1@uni-berlin.de...
    >
    >>Afraid not. Now it's stopping at VALUES and complaining "expected end
    >>of statement"
    >>
    >>Steve
    >>
    >>MacDermott wrote:
    >>
    >>>Ah -
    >>> that old word wrap!
    >>>The line that you see starting with VALUES belongs at the end of the
    >>>previous one.
    >>> Make sure there's a space before VALUES.
    >>>
    >>>HTH
    >>> - Turtle
    >>>
    >>>"Stephen Glynn" <stephen.glynn@ntlworld.com> wrote in message
    >>>news:2jjsb8F11208bU1@uni-berlin.de...
    >>>
    >>>
    >>>>Sorry, I'm a real baby at this.
    >>>>
    >>>>It's falling over at
    >>>>
    >>>>VALUES ('" & ctl.Name & "','" & ctl.tag & "')"
    >>>>
    >>>>In particular it's stopping at the first single quote mark.
    >>>>
    >>>>Please help.
    >>>>
    >>>>Steve
    >>>>
    >>>>MacDermott wrote:
    >>>>
    >>>>
    >>>>>WARNING: AIR CODE
    >>>>> (Create tblTemp, with two text fields, ControlName and ControlTag,
    >>>>>before executing this.)
    >>>>>
    >>>>>Public sub ListControls()
    >>>>> dim ctl as Control
    >>>>> for each ctl in Me.Controls
    >>>>> if TypeOf ctl Is Checkbox then _
    >>>>> currentdb.execute "INSERT INTO tblTemp (ControlName,
    >>>
    >>>ControlTag)
    >>>
    >>>
    >>>>>VALUES ('" & _
    >>>>> ctl.Name & "','" & ctl.tag & "')"
    >>>>> endif
    >>>>> next
    >>>>>End Sub
    >>>>>
    >>>>>
    >>>>>"Stephen Glynn" <stephen.glynn@ntlworld.com> wrote in message
    >>>>>news:2jitktF12ga8vU1@uni-berlin.de...
    >>>>>
    >>>>>
    >>>>>
    >>>>>>I'm trying to check a very large form.
    >>>>>>
    >>>>>>It contains a lot of unbound check boxes, the tag property of each of
    >>>>>>which (I hope) corresponds to the ItemID field (primary key) in
    >>>>>>tblMyTable and the name property of which corresponds with the
    >>>>>>appropriate ItemCode field in the same table.
    >>>>>>
    >>>>>>The form's been constructed manually and proof-read manually. Is
    >
    > there
    >
    >>>>>>a way of extracting the controls' names and tags and inserting them
    >>>>>>into a temporary table so I can then run a find unmatched query with
    >>>>>>tblMyTable? (I'm hoping that there will be no unmatched entries).
    >>>>>>
    >>>>>>Steve
    >>>>>
    >>>>>
    >>>>>
    >>>
    >
    >


  • Next message: MacDermott: "Re: Checking control properties"

    Relevant Pages