views:

766

answers:

2

Is is possible to call a custom VB function, saved in the same Access Db, from a query written in that db, and if so, how?

+1  A: 

Yes, you can call a macro or function from an Access query. Make your function public. Then call it inside your SQL like so:

 CustomFunction([field])
A: 

Ok, here's the deal, Paul W.

I was trying to get this done before I asked the question and, upon reflection (not the .NET kind!) I think my question could have used a bit more elaboration.

When you answered (and I think your answer could have used a bit more elaboration too) it didn't seem different from what I'd tried, so I looked at my code again. I found a stupid bug that was preventing me from getting the result I was looking for. I've fixed it and everything's fine now.

So, in the end, I didn't ask the question that was really bothering me, and therefore you didn't give me the solution I was looking for. However, you did cause me to find the solution so I'd like to give you your props. However, I apparently don't have enough reputation (yet) to accept your answer or comment on it, so this reply will have to do. (I keep clicking on the checkmark but nothing happens.)

Stonefish
You should always be able to accept the answer to a question you have posted, regardless of your rep.
Mitch Wheat
Well, it works now, making me seem like a liar, but I promise - it wasn't letting me do that the last time.
Stonefish
Aha! I can leave comments now, even though the FAQ says I have to have a rep of 50 to do so. This means that Jeff, etc changed the rules since I was last here, sometime last week. Therefore, one of the rules they must have changed (or fixed) must have been how answered can be accepted. Good.
Stonefish