Page 1 of 2 12 LastLast
Results 1 to 15 of 24
  1. #1
    Join Date
    Nov 2006
    Posts
    34

    Unanswered: illegal field name or invalid input for myform!.Tform.component.text (was "problem")

    i have the next problem

    in a
    select mycode from statment
    WHERE colx = "&myform!.Tform.component.text!&"
    the errormessage is
    Error:
    Illegal field name or invalid Input.
    You may need to use quotes.


    ok i understand this but until now it was working almost
    because it returned blank data rows
    help needed only in ideeas, i d'ont need a solution

    Lehel

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    I don't know what your "previous" problem was for context regarding your "next" problem.


    I do know that you've got some funky syntax going on there.

    Try forms!yourForm!yourControl.text

    You have an extra exclamation at the end. Also, you may need to wrap up your argument in quotes if colx is a non-numeric datatype.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Nov 2006
    Posts
    34
    i've tryed thath and it doesn't works.the sintax is like the next example and i have too use it for 4-5 times in the program

    SELECT DISTINCT *
    FROM "D:\ISTI\28.11.2006\contractdetailat.dbf" Contractdetailat
    INNER JOIN "D:\ISTI\28.11.2006\firma.dbf" Firma
    ON (Contractdetailat.NRCONTRACT = Firma.NRCONTRACT) , "D:\ISTI\28.11.2006\delegati.dbf" Delegati
    WHERE (Contractdetailat.NRCONTRACT ='"&Tform!.intrari!.nrcontract.text!)&"*'%')

    please give me somme ideea because i'm stuckt and i need to finish this until cristmass.
    By the way i'm working alone with no help, only me and my books.
    Thanks

    Lehel

  4. #4
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    this
    ='"&Tform!.intrari!.nrcontract.text!)&"*'%')
    is absolutely horrible!

    to have some hope of tidying it up before Xmas, it would be nice to know:

    what is the datatype of contractdetailat.nrcontract ?

    is this SQL built in code, or is it in a saved query ?
    if built in code, where is the code running (name of form or module) ?

    what is the name of the form holding the control you want to use as criteria ?

    what is the name of the control you want to use as criteria ? (guess: nrcontract)

    and if not already covered above, what are the objects Tform, intrari ?

    which wildcard works for you '%' or '*' ?

    why have you have chosen to use .text rather than .value ?

    does the space-bar work on your keyboard ?

    izy
    currently using SS 2008R2

  5. #5
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    and one more question.

    the control (guess: nrcontract) - does it contain the entire value of contractdetailat.nrcontract or just the first few characters or ???

    izy
    currently using SS 2008R2

  6. #6
    Join Date
    Nov 2006
    Posts
    34
    in order the replies for your questions.
    1. The datatype of contractdetaliat.nrcontract is an integer value,
    2. this is a query on a form wits an SQL Query component with the code, on the intrari module
    3. the name of the control form is "Intrari"
    4. yess it is nrcontract and it is an edittextbox
    5. Delphy components working modules for winaplication
    6. the % but that is selecting all the data ex: 1% select for me 12,123,11,ectwich is not good i have to select only for ex the 123 contract number
    7 because the edit component of Tedit class in Delpy it does'nt have a value extension,

    Lehel

  7. #7
    Join Date
    Nov 2006
    Posts
    34
    yes the whole walue

    Lehel

  8. #8
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    if this was an access form then
    WHERE (Contractdetailat.NRCONTRACT ='"&Tform!.intrari!.nrcontract.text!)&"*'%')
    should read
    WHERE Contractdetailat.NRCONTRACT = " & me.nrcontract & ";"

    no ' (it is numeric)
    no % or * (you have exact value)
    no .text (default .value is easier to work with)
    no !. (illegal)

    no idea about your Delphy stuff tho

    izy
    currently using SS 2008R2

  9. #9
    Join Date
    Nov 2006
    Posts
    34
    for this it gives me an error
    WHERE (Contractdetailat.NRCONTRACT ='"&Tform!.intrari!.nrcontract.text!)&"*'%')
    ERROR Invalid use of Keyword TOKEN %

    Lehel

  10. #10
    Join Date
    Nov 2006
    Posts
    34
    the database extension is *.dbf

    Lehel

  11. #11
    Join Date
    Nov 2006
    Posts
    34
    Anodher question if i declare a variable, how could i use the variable value in the query?
    i asked this because evri field is introduced in the program into the tables.
    but i will not hanve the oportunity to write a query for all kind of contractnumber.
    guessing the sintax woud be similar
    WHERE (Contractdetailat.NRCONTRACT ='"&Tform!.intrari!.variable!)&"'*'%')
    rigth?

    Lehel

  12. #12
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    pleeeeeeeeeeeeease try my suggestion
    WHERE Contractdetailat.NRCONTRACT = " & me.nrcontract & ";"

    izy
    currently using SS 2008R2

  13. #13
    Join Date
    Nov 2006
    Posts
    34
    i'we tryed that and the rezult is somme blank datarows but i'm still working on it

    Lehel

  14. #14
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    maybe blank data rows is better than error messages.

    sitting in your application with form intrari open and something meaningful in the textbox called nrcontract

    hit
    Ctrl-G
    ...that should have opened the code window with the (empty) immediate window below it.
    in the immediate window type
    ? forms!intrari.nrcontract
    and hit the enter key after you type the last 't'

    IF the immediate window displays the meaningful content of textbox nrcontract in the line below what you just typed, the WHERE clause we were discussing should work.
    OTHERWISE whatever you are doing is not access - you could get lucky here and get a sensiible reply, but you might be better served finding another resource more specific to your environment.
    IN EITHER CASE even without knowing what environment you are in, your original WHERE clause seems likely to be wrong:
    a/ don't use * and % wildcards at the same time, and don't use any wildcards with =
    b/ dont use !. together like that. i believe that the rule is +/-
    collection!item
    object.property or object.control or object.control.property
    (as in the above Forms!(the collection)intrari.(the item)nrcontract(the control) (and there is a virtual .Value appended by default if you don't specify a different property))
    access is occasionally forgiving if you use the 'wrong' separator but both together like !. is doomed


    izy
    currently using SS 2008R2

  15. #15
    Join Date
    Nov 2006
    Posts
    34
    my sql helper file says the next things:

    "SQL queries
    The common query engine uses a convenient subset of SQL to access dBASE, FoxPro, Access, and Paradox tables. This subset can also be used to join server-based SQL tables with these tables. The appropriate BDE driver must be installed to allow server-based SQL access.
    To exploit the full functionality of the server, you can use your server's dialect of SQL. Use passthrough SQL to send native SQL statements directly to your database server to be executed there. Queries executed in the native dialect might not result in updateable cursors. If the appropriate BDE driver is installed, the BDE query interface functions can also be used to pass SQL statements to the server for processing, in the native dialect of a server-based system, such as Oracle or Sybase."

    Ok i'm using a dBaSe table insted of an Access table and the sqil returns me the next message for the sentence wich was sugested to me
    Token "me.nrcontract"
    eawen with a LIKE statment too.

    Lehel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •