Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass a query's field Value to Function

Status
Not open for further replies.

samn265

Technical User
Feb 12, 2002
35
US
Could anyone tell me how to pass the value of one field in a query back to a function? I.e. I have the following function:

Public Function InitialDate() As Date
InitialDate = DateSerial(2001, 7, 1)
MsgBox [InitialDate]
End Function

I would like to assign the "InitialDate" to get its value from a field in a query instead of what I have in the above example.
Any help is greatly appreciated.
Thanks
 
Code:
Public Function InitialDate() As Date
    InitialDate = rst![i]MyDateField[/i]
    MsgBox [InitialDate]
End Function


Where rst ~~ the query recordset /resultset.


MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top