Function Display Time

Function DisplayTime: MS Access Put this function in the Module of Access Output format will look like:   100 Hours 50 Minutes You can use this function in form, query or report Function DisplayTime(startDate As Date, endDate As Date, fmt As String)  Dim Hours As Long, Minutes As Long, totalSeconds As Long, SecondLeft As Long ‘format the differance of 2 dates or times totalSeconds = DateDiff(“s”, startDate, endDate) Hours = Int(totalSeconds / 3600) SecondLeft = totalSeconds Mod 3600 Minutes = Int(SecondLeft / 60) Select Case fmt    ‘ format = 100 Hours…

Read More

Function Open MS Access File

Function OpenAccess. Put this function in the Modules of your access file Public Sub OpenAccess(conPath As String)    Dim objAccess As Access.Application    ‘Create an instance of the Access application object.    Set objAccess = CreateObject(“Access.Application”)    ‘Access and display the application window.    objAccess.OpenCurrentDatabase conPath    objAccess.visible = True    objAccess.DoCmd.RunCommand acCmdAppMaximize    Application.DoCmd.RunCommand acCmdAppMinimize Some websites go cheap discount viagra as far as giving free trials. On the same time, these veterinarians usually select a unique method to promote their http://www.icks.org/data/ijks/1482460790_add_file_3.pdf purchasing viagra australia clinic. According to a…

Read More

Function Calculate Age()

Function GetAge() Put this function in the Module. If today date is 4/1/14 and DOB field is 2/4/2000 then =GetAge(DOB) = 14 You can use this function in form, query or report Function GetAge(Bdate) As Integer ‘ Handle negative date ranges i.e. Bdate > TodayDate ‘ If Bdate > Date then             Msgbox “Birth date is a future date”             GetAge =0 ElseIf IsNull(Bdate) Then            ‘ do nothing, display 0 if the DOB field is blank Else If Month(Date) <= Month(Bdate) And Day(Date) < Day(Bdate) Then                        GetAge…

Read More

Function Get User Login ID: MS Access

Function Get User Login ID. Put this function in the Module of Access. You can use this function anywhere in your database to get a user computer loginID. ================================= Public Function GetUserLogin() Lucky for you guys, there is a solution to this generic levitra online click here to find out more problem; online pharmacies. The emergence of erectile dysfunction during the act of coitus would not only destroy the man’s confidence in his own abilities in general. viagra price Issues in the relationship can also contribute to erectile dysfunction condition…

Read More

Function Open Ms Word from Access

 Function Open MS Word. Put this function in the Module. Function OpenMSWord(conPath As String) Dim appword As Word.Application Dim doc As Word.Document On Error Resume Next Error.Clear Set appword = GetObject(, “word.application”) If Err.number <> 0 Then Set appword = New Word.Application appword.Visible = True End If Set doc = appword.Documents.Open(conPath, , True) appword.Visible = True appword.Activate Set doc = Nothing Set appword = Nothing End Function Under the click event of button, call function and pass value of file path inside function.  Private Sub Command2_Click()D im Path As String…

Read More