Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Location
    Europe
    Posts
    369

    Question Unanswered: "invalid use of Me keyword"?

    I have a combobox that have been doing its job for some time, but when I compile the code I get an error stating that it is an ivalid use of the me keyword. Here is the code:

    Private Sub cboSelectEmployee_AfterUpdate()
    'Find the employee selected in the combo box
    Me.Recordset.FindFirst "EmployeeID = " & Me.cboSelectEmployee

    etc.. - the error stops and highlights the last "Me."

    What is wrong?

  2. #2
    Join Date
    Oct 2001
    Location
    Chicago
    Posts
    440
    Did you check for missing references?

  3. #3
    Join Date
    Dec 2003
    Posts
    172
    are you referencing this combo from a subform or another form or vb procedure? if so you have to use forms!myformname rather than me.

    this happens frequently when we move vb code to a central function and forget that the me keyword only applies when you are within the class object

    you might also check for me.mycontrolname to make sure the control name wasn't renamed to something else

    finally you should make sure you are not getting a null value (use the nz() function to make certain me returns something

    joeg

Posting Permissions

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