By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,093 Members | 1,043 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,093 IT Pros & Developers. It's quick & easy.

VB6 dll passing dates

P: n/a
dear gurus can you check i had written dll file in vb6 and call in
access added via reference.

here are the coding of dll file
+++++++++++++++++++++++++++++++++
Public Function f_Dtloan(dt_dob As Date, Dt_loan As Date) As Date
ageEntry = DateDiff("yyyy", "# & dt_dob & #", "# & Dt_loan & #")
End Function
+++++++++++++++++++++++++++++++++

as you know the function is written in dll, so we need to call it then
pass the value.and here are the coding of forms buttons:
+++++++++++++++++++++++++++++++++
Public objDate As New Project1.basDate

Private Sub Command1_Click()
MsgBox objDate.f_Dtloan(Text2.Text, Text1.Text)
End Sub
+++++++++++++++++++++++++++++++++
so can any one check it gives me results zero "0" always i don't know
where i am making mistakes in VB6 or VBA coding is 99% same
rgds,
shahzad

Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 25 Jan 2005 21:32:24 -0800, "SalimShahzad" <sa**********@gmail.com>
wrote:
dear gurus can you check i had written dll file in vb6 and call in
access added via reference.

here are the coding of dll file
+++++++++++++++++++++++++++++++++
Public Function f_Dtloan(dt_dob As Date, Dt_loan As Date) As Date
ageEntry = DateDiff("yyyy", "# & dt_dob & #", "# & Dt_loan & #")
End Function
+++++++++++++++++++++++++++++++++

as you know the function is written in dll, so we need to call it then
pass the value.and here are the coding of forms buttons:
+++++++++++++++++++++++++++++++++
Public objDate As New Project1.basDate

Private Sub Command1_Click()
MsgBox objDate.f_Dtloan(Text2.Text, Text1.Text)
End Sub
+++++++++++++++++++++++++++++++++
so can any one check it gives me results zero "0" always i don't know
where i am making mistakes in VB6 or VBA coding is 99% same
rgds,
shahzad


don't post VB problems into an Access Newsgroup (further on in a Group
without VBA)

you define a function as Date, you calculate a number (without
defining it) and you never assign a result to your function.
---
If you expect an answer to a personal mail, add the word "manfred" to the first 10 lines in the message
MW
Nov 13 '05 #2

P: n/a
On 25 Jan 2005 21:32:24 -0800, "SalimShahzad" <sa**********@gmail.com>
wrote:
dear gurus can you check i had written dll file in vb6 and call in
access added via reference.

here are the coding of dll file
+++++++++++++++++++++++++++++++++
Public Function f_Dtloan(dt_dob As Date, Dt_loan As Date) As Date ageEntry = DateDiff("yyyy", "# & dt_dob & #", "# & Dt_loan & #")
Try:

ageEntry = DateDiff("yyyy", "#" & dt_dob & "#", "#" & Dt_loan & "#")
End Function
+++++++++++++++++++++++++++++++++

as you know the function is written in dll, so we need to call it then
pass the value.and here are the coding of forms buttons:
+++++++++++++++++++++++++++++++++
Public objDate As New Project1.basDate

Private Sub Command1_Click()
MsgBox objDate.f_Dtloan(Text2.Text, Text1.Text)
End Sub
+++++++++++++++++++++++++++++++++
so can any one check it gives me results zero "0" always i don't know
where i am making mistakes in VB6 or VBA coding is 99% same
rgds,
shahzad


Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.