i have a listview that i want to convert the access to excel
everything shows fine except the date that shows some numbers intead of the real date
this is my code
everything shows fine except the date that shows some numbers intead of the real date
this is my code
Code:
Private Sub BttnExcel_Click()
Dim rs As Recordset
Dim sql As String
Dim xlApp As New Excel.Application
Dim xlwk As New Excel.Workbook
Dim i As Long
screen.MousePointer = vbHourglass
Set rs = New Recordset
rs.LockType = adLockOptimistic
rs.CursorType = adOpenKeyset
sql = "Select * from Customers"
rs.Open sql, CN, , adLockOptimistic
xlApp.Interactive = True
Set xlwk = xlApp.Workbooks.Open(App.Path & "\ExcelInventory\ExcelReport.xls")
xlApp.Range("A" & Trim(Str(1))).Value = "Oxygen cust"
xlApp.Range("B" & Trim(Str(1))).Value = "HairColour cust "
xlApp.Range("C" & Trim(Str(1))).Value = "Cellular cust"
xlApp.Range("D" & Trim(Str(1))).Value = "Phone cust"
xlApp.Range("E" & Trim(Str(1))).Value = "Email cust"
xlApp.Range("F" & Trim(Str(1))).Value = "Facebook cust"
xlApp.Range("G" & Trim(Str(1))).Value = "DateBirth"
xlApp.Range("H" & Trim(Str(1))).Value = "Address cust"
xlApp.Range("I" & Trim(Str(1))).Value = "FullName cust"
i = 2
Do Until rs.EOF
xlApp.Range("A" & Trim(Str(i))).Value = rs!Oxygen
xlApp.Range("B" & Trim(Str(i))).Value = rs!HairColour
xlApp.Range("C" & Trim(Str(i))).Value = rs!Cellular
xlApp.Range("D" & Trim(Str(i))).Value = rs!Phone
xlApp.Range("E" & Trim(Str(i))).Value = rs!Email
xlApp.Range("F" & Trim(Str(i))).Value = rs!Facebook
xlApp.Range("G" & Trim(Str(i))).Value = rs!DateBirth
xlApp.Range("H" & Trim(Str(i))).Value = rs!Address
xlApp.Range("I" & Trim(Str(i))).Value = rs!FullName
i = i + 1
rs.MoveNext
Loop
xlApp.Visible = True
screen.MousePointer = vbNormal
End sub