|
-
May 9th, 2006, 09:25 PM
#1
Thread Starter
New Member
Completely New to VBA, Issue regarding Custom Functions
I have reviewed the forums and I am fairly sure that my issue is that I do not know how to properly reference the access database and table table in my code.
My quest:
I want to be able to place a custom function in query that looks at a certain date field within the table and returns values based on what it sees. If I can get the below code to work, I will extrapolate to return about 15 different values based on what it finds in the "Duedate" field in "Tbl1." I am working within a VB module contained in the same access database that the table "tbl1" is stored.
Again, I believe where I am failing is the proper syntax for referencing the table and the field, and I believe making proper declarations. I know it must be simple but I am learning on my own and I cant find the answer.
VB Code:
Public Function AgingCat()
If Month(TBL1.DUEDATE) >= Month(Date) And Year(TBL1.DUEDATE) >= Year(Date) Then
AgingCat = "CURRENT"
End If
End Function
Please help!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|