• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1019
  • Last Modified:

Using AddressOf function in Access97 VBA

I'm using the following code in my database to sort a listview control..

SendMessage axLV1.hWnd, LVM_SORTITEMS, axLV1.hWnd, AddressOf CompareDates
and each and every time i want to write this line, in any fashion i could imagine, access responded me Expected : Expression..

When i write AddressOf and i press space, Access gives me suggestions on the function names i can use and i use one of them, but Access keeps telling me that it expects an expression... !!!  Help me please !!

  • 2
1 Solution
little_Author Commented:
Edited text of question
Do you have the CompareDates function in your application ?
little_Author Commented:
Yes, the function exists.  When i press the space bar after writing the addressof expression, the function i want to uses is part of the choices in the list.
The Declare statement for SendMessage must define the parameter to receive the AddressOf "As Any". If this is not it, please post the declaration for SendMessage and CompareDates.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now