hi my name is vishal
i am using vb6 as front-end and ms access as back-end. I dont want to use data report instead i want to export these multiple table values to excel.
i have tried a code given below: - Option Explicit
-
Dim dIsVisible As Boolean
-
Dim inst As String
-
Dim adoDatabase As ADODB.Connection
-
Dim oRs As ADODB.Recordset
-
-
-
-
Sub getDialyzerInfo()
-
Me.Caption = "Dialyzer Info"
-
fmeDialyzerID.Visible = True
-
fmePatientwise.Visible = False
-
dIsVisible = True
-
End Sub
-
-
Private Sub cmdGenerate_Click()
-
Dim xlApp As Excel.Application
-
Dim wb As Workbook
-
Dim ws As Worksheet
-
Dim var As Variant
-
-
Set xlApp = New Excel.Application
-
Set wb = xlApp.Workbooks.Open("D:\Workarea\vishal\130918\dialyser.xls.xlsx")
-
Set ws = wb.Worksheets("Sheet1")
-
Me.Hide
-
Dim adoDatabase As New ADODB.Connection
-
Dim oRs As New ADODB.Recordset
-
If (dIsVisible = True) Then
-
If (Trim(Text1.Text) <> "") Then
-
adoDatabase.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};" & _
-
"Dbq=tuscanDB.mdb;" & _
-
"DefaultDir=" & App.Path & ";" & _
-
"Uid=Admin;Pwd=;"
-
adoDatabase.Open
-
oRs = adoDatabase.Execute("select r.dialysis_date,pn.patient_first_name,pn.patient_last_name, d.manufacturer,d.dialyzer_size,r.start_date,r.end_date,d.packed_volume,r.bundle_vol,r.disinfectant,t.technician_first_name,t.technician_last_name from dialyser d,patient_name pn, reprocessor r, techniciandetail t where pn.patient_id=d.patient_id and r.dialyzer_id=d.dialyserID and t.technician_id=r.technician_id and d.deleted_status=false and pn.status=true and d.dialyserID=('" & Text1.Text & "') order by r.dialysis_date desc,pn.patient_first_name,pn.patient_last_name", "DCS Clinical Report-For Dialyzer ID(" & Text1.Text & ")")
-
End If
-
Else
-
If cboPatientID.ListIndex = 0 Then
-
Set oRs = adoDatabase.Execute("select r.dialysis_date,pn.patient_first_name,pn.patient_last_name, d.manufacturer,d.dialyzer_size,r.start_date,r.end_date,d.packed_volume,r.bundle_vol,r.disinfectant,t.technician_first_name,t.technician_last_name from dialyser d,patient_name pn, reprocessor r, techniciandetail t where pn.patient_id=d.patient_id and r.dialyzer_id=d.dialyserID and r.dialysis_date between cdate('" & dtFrom.Value & "') and cdate('" & dtTo.Value & "') and t.technician_id=r.technician_id and d.deleted_status=false and pn.status=true order by r.dialysis_date desc,pn.patient_first_name,pn.patient_last_name", "DCS Clinical Report - Patient wise")
-
Else
-
Set oRs = adoDatabase.Execute("select r.dialysis_date,pn.patient_first_name,pn.patient_last_name, d.manufacturer,d.dialyzer_size,r.start_date,r.end_date,d.packed_volume,r.bundle_vol,r.disinfectant,t.technician_first_name,t.technician_last_name from dialyser d,patient_name pn, reprocessor r, techniciandetail t where pn.patient_id=d.patient_id and r.dialyzer_id=d.dialyserID and r.dialysis_date between cdate('" & dtFrom.Value & "') and cdate('" & dtTo.Value & "') and d.patient_id=" & Left(cboPatientID.List(cboPatientID.ListIndex), InStr(cboPatientID.List(cboPatientID.ListIndex), "|") - 1) & " and t.technician_id=r.technician_id and d.deleted_status=false and pn.status=true order by r.dialysis_date desc,pn.patient_first_name,pn.patient_last_name", "DCS Clinical Report - Patient wise")
-
End If
-
End If
-
Unload Me
-
End Sub
but i get error(run-time)"Invalid procedure call or argument"
Can anyone help me please?
1 1310
On which line of code do you get the error?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Katrina |
last post by:
I am trying to write a piece of code that will search through a number
of different tables (current one being tableNm) to look for a specific
street name that has been entered by the user and saved...
|
by: Shashi |
last post by:
I have developed ASP.Net application using .Net 1.1 Framework.
When the user clicks image file through Java script I am using my search
window as below.
QueryString =...
|
by: bader |
last post by:
I need some assistance with a format in Access.
I need several tables to use the same pool of autogenerated numbers (badge numbers) and automatically fill that value upon each record generation. I...
|
by: tezza98 |
last post by:
I need some help.
Im using a dtsrun command to import 9 tables into an Access database, most of the tables have about 1000 rows, but one has 20000+ rows and grows everyday. Im Using Access 2003...
|
by: eBob.com |
last post by:
I am creating an Excel 2002 sheet programmatically using VB.Net. It all
works fine. But now I'd like to add a photograph to each row. I've done
searches but all the hits I get must be for VBA...
|
by: Kimg0123 |
last post by:
I would like to be able to append data from multiple tables into a single summary table using either an event procedure for the On Load or On Open properties on a form, but cannot seem to figure this...
|
by: danorourke99 |
last post by:
Hi,
In my Access database I have a table (dbo_000_DataCubeProcessing) which contains a list of tables that I need to export to Excel on a regular basis along with a checkbox for each. Once I...
|
by: ak1dnar |
last post by:
Please have a look at this sample tables.
Table : users
1001 | USER-1
1002 | USER-2
1003 | USER-3
Table: Schools
|
by: shakthisarav |
last post by:
Hi,
problem:
Add one combo to the excel spreadsheet. let it be in cell 'd1'.the combo should contain items as lock & unlock.when we click on lock the cells a1:c1 must be disabled. the cell e1...
|
by: srikanya |
last post by:
Hi,
I have a database with 10 tables and I want to export all table data into excel file.But there should be only one excel file with different sheets in it, each containing different tables data.
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
| |