Re: Method or Data Member Not Found, but definitely there
From: Matthew DeAngelis (mattd_at_proquestvc.com)
Date: 08/16/04
- Next message: SHIPP: "Trying to transfer control to a second Access database"
- Previous message: Sergey Poberezovskiy: "Re: Running queries with VBA functions in external database"
- In reply to: TC: "Re: Method or Data Member Not Found, but definitely there"
- Next in thread: TC: "Re: Method or Data Member Not Found, but definitely there"
- Reply: TC: "Re: Method or Data Member Not Found, but definitely there"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 16 Aug 2004 07:50:32 -0700
TC wrote:
> Try referencing the fields seperately, to be sure which one is being
> objected to:
>
> dim v as variant
> v = me.postmoney
> v = me.postmoney2
> etc.
>
> BTW:
>
> - why ' Like "Between" ' ? No point using Like without any wildcards
> :-)
>
> - you say this is the last If statement in a series of If statements
> structured in the exact same way, but with different field names.
> Maybe have a single If statement in a function, and call the function
> repeatedly, passing the relevant fieldnames as parameters.
>
> HTH,
> TC
>
>
> "Matthew DeAngelis" <mattd@proquestvc.com> wrote in message
> news:#SA6o07fEHA.2908@TK2MSFTNGP10.phx.gbl...
> > I am having an odd problem with this code:
> >
> > If Not IsNull(Me.PostMoney) Then
> > If Me.PostMoneyCompValue Like "Between" Then
> > stSearchCriteria = stSearchCriteria & Trim("[PostMoney]
> > " & Me.PostMoneyCompValue & " " & Me.PostMoney & " And " &
> > Me.PostMoney2 & " " & Me.PostMoneyAndOr & " ")
> > Else
> > stSearchCriteria = stSearchCriteria & Trim("[PostMoney]
> > " & Me.PostMoneyCompValue & " " & Me.PostMoney & " " &
> > Me.PostMoneyAndOr & " ")
> > End If
> > End If
> >
> > This is the last If statement in a series of If statements
> > structured in the exact same way, but with different field names.
> > My problem is that the compiler chokes on Me.PostMoney2, saying
> > 'method or data member not found', despite the presence of the
> > field. In fact, if I type Me. to bring up the list of fields, I
> > can double-click PostMoney2 to add it, but the compiler still
> > refuses to recognize it. Previously, before I added PostMoney2, I
> > was getting the same error in that line for PostMoney, even though
> > the compiler accepted that field as part of the If Condition.
> >
> > Is there any reason why the compiler should acknowledge a field in
> > some instances and not in others?
> >
> >
> > Thanks,
> > Matt
Thanks TC, that works just fine, although it is a tad annoying to look
at. Any idea what is causing this problem?
Good catch on the Like Between, by the way :). I will look at creating
a catchall function.
Much Appreciated,
Matt
- Next message: SHIPP: "Trying to transfer control to a second Access database"
- Previous message: Sergey Poberezovskiy: "Re: Running queries with VBA functions in external database"
- In reply to: TC: "Re: Method or Data Member Not Found, but definitely there"
- Next in thread: TC: "Re: Method or Data Member Not Found, but definitely there"
- Reply: TC: "Re: Method or Data Member Not Found, but definitely there"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|