473,387 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

problem with Datareport please help me iam final stage in my project

hi this is pramod i am facing a small problem
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command_Click()
  2. Dim a As String
  3.  
  4. a = InputBox("enter empno")
  5.  
  6. If rs.State = 1 Then rs.Close
  7.  
  8. rs.Open "select * from microbiology Where bat_num = " & a, cn, adOpenForwardOnly, adLockReadOnly
  9.  
  10. LinkDataReport1
  11.  
  12. end sub
  13.  
  14. Public Sub LinkDataReport1()
  15.  
  16. With DataReport2
  17.  
  18.     'We must set The DataReport source to nothing!
  19.     'Else DataReport wants to use its own Source
  20.     Set .DataSource = Nothing
  21.     .DataMember = ""
  22.  
  23.         'We Connect the DataReport to our Recordset Since
  24.         'we disallowed DataReport1 to use its own above
  25.         Set .DataSource = rs
  26.  
  27.         'Here we are 'Hard Coding the textboxs to the fields
  28.         With .Sections("Section1").Controls
  29.             .Item(1).DataMember = ""
  30.             .Item(1).DataField = rs.Fields(0).Name
  31.             .Item(2).DataMember = ""
  32.             .Item(2).DataField = rs.Fields(1).Name
  33.             .Item(3).DataMember = ""
  34.             .Item(3).DataField = rs.Fields(2).Name
  35.             .Item(4).DataMember = ""
  36.             .Item(4).DataField = rs.Fields(3).Name
  37.             .Item(5).DataMember = ""
  38.             .Item(5).DataField = rs.Fields(4).Name
  39.        End With
  40.  
  41.     .Show
  42.  
  43. End With
  44.  
  45. End Sub
In the above code i am getting a RUNTIME Error i.e

Object does not support this property or method

while in the above code when iam using with datareport1 i am not getting error
what is the problem i am not able to understand please help if any can
Apr 26 '07 #1
6 2165
Killer42
8,435 Expert 8TB
Do you know which line produces the error?
Apr 26 '07 #2
Do you know which line produces the error?

.Item(1).DataMember = ""
.Item(1).DataField = rs.Fields(0).Name

error: object doesn't support this property or method
Apr 28 '07 #3
Dököll
2,364 Expert 2GB
.Item(1).DataMember = ""
.Item(1).DataField = rs.Fields(0).Name

error: object doesn't support this property or method
Hey there, pramodrepaka!

Looks like you dimensioned a, but you did not do the same for rs. Your problem may be more specific. Also, run your code in debug mode to see what it is doing:

(1) Choose Debug
(2) Step Into
(3) Hit F8 until you each the error pop up

I will plug in your code see what it does here...
Apr 29 '07 #4
Dököll
2,364 Expert 2GB
.Item(1).DataMember = ""
.Item(1).DataField = rs.Fields(0).Name

error: object doesn't support this property or method
Hey there, pramodrepaka!

Looks like you dimensioned a, but you did not do the same for rs. Your problem may be more specific. Also, run your code in debug mode to see what it is doing:

(1) Choose Debug
(2) Step Into
(3) Hit F8 until you each the error pop up

I will plug in your code see what it does here...
Apr 29 '07 #5
hey
i tried what u said but i am not able to solve the problem i,e the error is
.Item(1).DataMember = ""
.Item(1).DataField = rs.Fields(0).Name


the error number is 438
and the error message is
object doesn't support this prorperty or method
what 2 do i am not able 2 understand plz help me
Hey there, pramodrepaka!

Looks like you dimensioned a, but you did not do the same for rs. Your problem may be more specific. Also, run your code in debug mode to see what it is doing:

(1) Choose Debug
(2) Step Into
(3) Hit F8 until you each the error pop up

I will plug in your code see what it does here...
May 4 '07 #6
Killer42
8,435 Expert 8TB
.Item(1).DataMember = ""
.Item(1).DataField = rs.Fields(0).Name
There are two lines there. We still don't know which one produces the error. Which also means that we don't know whether the error refers to .Item(1) or rs.Fields(0).

You need to be more specific.
May 4 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Paul T. RONG | last post by:
Hello, I am making a restaurant database (it is much more complicated than I thought before!), now it comes to the last stage and I come across a problem. I will explain it in detail. In a...
1
Awit
by: Awit | last post by:
Hello, I'm new here... I have a problem, I used DataReport in my program.. The problem is runtime error occur when i run the system, i can't make some modification at the table in database while...
5
by: anoopgopal007 | last post by:
Hi, I am using vb6 and datareport. I am updating the tables whle the program running. But the datareport doesnot show the updated information. Its always shows the previous value. But...
0
by: nishjee | last post by:
Hello friends, i need visual basic 6.0 code to export a datareport to html other than the defult option coming with datareport. I need this very urgently because when i am exporting the datareport...
6
by: Neelesh2007 | last post by:
Hi all. In my project I am using VB6.0 & Access 2003. I want to create Slab wise & Pagewise Datareport as shown below. Marks <30 ID Subject Marks 11 Maths 25 75 ...
9
smartchap
by: smartchap | last post by:
I have a table having 3 fields viz. SNo, FName and LName. The table has 10 records having SNo from 1 to 10. In DataReport I have 3 labels and 3 textboxes. I want to display all records from 1 to 10...
0
by: Manojthanal | last post by:
Hai I am making a VB Acsess project Via DSN method. How we connect this with Datareport. How we get data to Datareport from the tabe using SQL Qury. I am Working first time with data report. My...
1
by: MaryKJolly | last post by:
I got this sample project from a website. But there is some syntax error in the statement which contains the CDate function. I can't detect the error? Can enybody help me? SUMMARY This article...
1
by: premMS143 | last post by:
Hi, I'm developing a VB project. Description: 1. Printing all the records present in MS Access database using DataReports. 2. In database the following fields are there; > Name ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.