i am writing program in vb 6.0 with msacesss as the database.what the program is about is hardware insurance management system.there is date registered in the entry form and date expir.i want explanation on how to use the date diff with code on to calculate the date difference.so that when a registration expire the msgbox we alert me that a registration as expired. thanks.

Hi,

Try This :

Dim i As Integer
i=DateDiff("d",CDate(txtEntDate), CDate(txtExpDate))

Regards
Veena

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.