Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2005
    Posts
    154
    Provided Answers: 1

    Unhappy Answered: Error message when clicking a button

    Hello All,

    I am trying to figure out why I am seeing an error message as I click on either the clear button or show all records button.
    the error message that was receiving at first was "Type mismatch"

    I decided to move the table, form and module to a blank database and the error code changed to "Expected user-defined type, not project"

    I am not sure what is causing this.

    any help is appreciated!

    Db and error message screenshot is attached.

    Regards,
    Attached Thumbnails Attached Thumbnails error.JPG  
    Attached Files Attached Files

  2. Best Answer
    Posted by ranjah

    "Thanks a lot, MikeTheBike!

    that worked like a charm."


  3. #2
    Join Date
    Apr 2004
    Location
    Derbyshire, UK
    Posts
    805
    Provided Answers: 2
    Hi

    The DoCmd.ApplyFilter argument is not a query, it is a Where statement, but without the Where (as used below). It's also the second argument.

    I don't usually use the DoCmd, I just filter the form,
    for example
    Code:
        Me.Filter = "LoginName = '" & UserLoginName & "'"
        Me.FilterOn = True
    you can then get the record count like this

    Code:
        MsgBox Me.RecordsetClone.RecordCount
    To remove the filter use
    Code:
        Me.FilterOn = False
    HTH


    MTB

  4. #3
    Join Date
    Jul 2005
    Posts
    154
    Provided Answers: 1
    Thanks a lot, MikeTheBike!

    that worked like a charm.

Posting Permissions

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