Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2002
    Posts
    3

    Unanswered: Data type mismatch

    All,

    I have the following statement in an update form:
    UPDATE table1
    SET Status=':tatus::'
    WHERE ID='::ID::'

    When I try to run this I get the Data type mismatch error. This is an auto generated form (minus the sql statement) and am unsure how to correct this error.

    The data type for the field is autonumber which it needs to be as it is the only unique identifier of the record in the table. I'm sure the form attempts to pass it as text thus giving me the error.

    If someone could help with one of the following it would be greatly appreciated.

    1. Advise as to a way to correct either the sql statement so it works. Or a suggestion as to how to correct the form.

    2. A way to duplicate the "ID" field in the database into a new TEXT data type field.

    Thanks in advance,

    Ron S.

  2. #2
    Join Date
    Sep 2002
    Location
    Coventry, Warwickshire, UK
    Posts
    74
    I am not sure what ':tatus::' and '::ID::' are supposed to be, but as they stand '::ID::' is a text field and you say ID is an autonumber (long integer) field. No wonder you are getting a Data type mismatch.

    Could you explain what they are. Are they controls on the form containing the data?
    Roger Hampson
    XI - ecs (UK) Ltd

  3. #3
    Join Date
    Oct 2002
    Posts
    3
    Thanks for the response,

    The fields ':tatus::' and '::ID::' represent the one-line text box form fields.

  4. #4
    Join Date
    Aug 2002
    Location
    Québec, Canada
    Posts
    109
    That is the SQL statement, but how do you create it? Show the code

    UPDATE table1
    SET Status=':tatus::'
    WHERE ID='::ID::'

    It should look likes:

    Code:
    strSQL = "UPDATE table1 SET Status = '" & txtStatus.value & "' WHERE ID = " & CLng(txtID.value)
    JefB

  5. #5
    Join Date
    Oct 2002
    Posts
    3
    Oh, sorry -

    fp_sQry="UPDATE table1 SET Status=':tatus::' WHERE ID='::ID::' "
    fp_sDefault="Status=&ID="

    Notice this is done in front page.

Posting Permissions

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