Results 1 to 4 of 4

Thread: Can you see my error?

  1. #1

    Thread Starter
    Addicted Member smh's Avatar
    Join Date
    Oct 2000
    Location
    South Dakota, USA
    Posts
    249
    Can you find where my error is. I don't see one. This code is from a module. The value of frmForm is a variable which pulls in the form that called the procedure. I keep getting the "Type mismatch" error on the astricked line.



    rst.Open "SELECT * FROM " & strContactTable & " " & _
    "WHERE '" & strComboBox & "' ='" & strComboContents & "' ;", cnn, adOpenKeyset, adLockOptimistic

    'Filling in the contact Boxes

    * frmForm!cboContact.Text = rst!contact
    frmForm!mskPhone = rst!Phone
    frmForm!txtExtension = rst!extension
    frmForm!mskFax = rst!fax
    frmForm!txtEmail = rst!Email


    The contact field is a varchar field with a lenght of 50.

    The mskPhone masked edit box has the following mask:
    (___) ___ - ____

    The phone field is a char field with a lenght of 16.

    I do not have any problems after those two fields.

    Any suggestions?
    Normal is boring...

    smh

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Use
    frmForm.cboContact.Text = rst!contact

    The ! notation only seems to apply for recordsets.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3
    Member
    Join Date
    Oct 2000
    Location
    Bath, England
    Posts
    45
    Tried
    = cstr(rst!contact) ?
    SJRigby

  4. #4

    Thread Starter
    Addicted Member smh's Avatar
    Join Date
    Oct 2000
    Location
    South Dakota, USA
    Posts
    249
    The cstr() fixed the error. I also had to take the single quotes off of the 'strComboBox' variable.
    Normal is boring...

    smh

Posting Permissions

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



Click Here to Expand Forum to Full Width