Results 1 to 8 of 8
  1. #1
    Join Date
    Dec 2010
    Posts
    134
    Provided Answers: 1

    Unanswered: Object doesn't support this property or method

    Hi

    I am getting this error >>>Object doesn't support this property or method<<< when I run the following code from my form. I use this function all over the place and now and then I get this error and it is slowly killing me ...

    Private Sub Application_Click()

    DoCmd.OpenForm "frmdseDABSubmission", acViewForm, , "[Application] = '" & Me.Application & "'"

    End Sub

    Can anyone hint at why this is happening? Massive appreciation in advance....

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    You might try bracketing Application, as it's a reserved word:

    Me.[Application]
    Paul

  3. #3
    Join Date
    Dec 2010
    Posts
    134
    Provided Answers: 1
    Hey P

    The brackets didn't fix it. Should I go as far as changing the field name do yuo thing? Application_1 or something?

    Private Sub Application_Click()

    DoCmd.OpenForm "frmdseDABSubmission", acViewForm, , "[Application] = '" & Me.[Application] & "'"

    End Sub

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Dec 2010
    Posts
    134
    Provided Answers: 1
    Hey

    thanks for that - I looked at those pages and I am now wondering why my code looks so different to what is there.

    I changed the field name to application_name, to see if that makes a difference:
    Private Sub Application_Click()

    DoCmd.OpenForm "frmdseDABSubmission", acViewForm, , "[Application_Name]= '" & Me.[Application_Name] & "'"

    End Sub

    ...but the same error occurs.

    Any further thoughts appreciated hugely.

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    look again at the reference, you cant just make up parameters unless they are your own enuimerations. if you are usign soemone else's code then you have to use their enumerations. if you don't want to, or dont' know which value to set then generally speaking VBA functions will default to a 'sensible' answer.
    I'd rather be riding on the Tiger 800 or the Norton

  7. #7
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Good eye healdem; I didn't notice that.

  8. #8
    Join Date
    Dec 2010
    Posts
    134
    Provided Answers: 1
    Ok so thank you both for your help here ...

    this now works:

    Private Sub Text21_Click()
    DoCmd.OpenForm "frmPhaseDates", acNormal, , "[Phase] = '" & Me.Phase & "'", , acDialog

    End Sub

    The issue I am having is in the appreciation of the order in which the arguments should be placed. Whilst that yellow box pop-up help does appear, I do find that the most difficult thing to read. I can't tell where one bit of it ends and where another begins.

    However in the snippet above, the fieldname is third and the acDialog is fifth argument .....in my head.

    Anyway, thank you both again.

    (Yes below I mention [Application] below but this was part of the overall problem and not a new thread).

    Massive thanks

Posting Permissions

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