hi experts please help me with this code

Private Sub cmdreport_Click()
Set crApp = New CRAXDRT.Application
frmViewReport.Show
  Set adorsRAM = New ADODB.Recordset
 Set report = crApp.OpenReport("D:\Ankush\created\proj11\Reports\Report1.rpt")  
 sSQL = "Select type, user, location, cpu_no, model, speed, ram_unit from Master where RAM=" & Form1.cmbram.Text
report.ParameterFields.Item("pRAM").Value = Str(cmbram.Text)
report.DiscardSavedData  'CLEARS REPORT SO WE WORK FROM RECORDSET
  report.Database.Tables(1).Location = "D:\Ankush\created\proj11\Database\IT_Stock.mdb"
  report.Database.Tables(1).TestConnectivity
  Set datacmd1 = New ADODB.Command
  Set datacmd1.ActiveConnection = cn
  datacmd1.CommandType = adCmdTable
 
  From adorsRAM
  
  report.Database.SetDataSource adorsRAM        'LINK REPORT TO RECORDSET

frmViewReport.CRViewer.ReportSource = report  'LINK VIEWER TO REPORT
frmViewReport.CRViewer1.ViewReport                             'SHOW REPORT

Do While CRViewer.IsBusy                        'ZOOM METHOD DOES NOT WORK WHILE
  'adorsRAM.Close
  'Set adorsRAM = Nothing
End Sub

please check if there is any error and help me in correcting the error
Thanks in advance

Recommended Answers

All 4 Replies

report.ParameterFields.Item("pRAM").Value = Str(cmbram.Text)

this line is showing error "type mismatch"

Type mismatch normally means that you are using diferent variable types in an assignment...

So, by the line you had show, I think you have two possibilities:

1. the "pRAM" variable not acept text type (strings, or so);
2. the "pRAM" variable doesn't exist in your report.


Try to check these and, if possible, post more information that could help others to help you too...


Cheers!
Sidnei

report.ParameterFields.Item("pRAM").Value = Str(cmbram.Text)

this line is showing error "type mismatch"

THANX A LOT
i have successfully completed my project

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.