Hi all,
why got this error message when run the program??
anyone help is much appreciated.
Line 28 error. -
Private Sub Prn2_Click()
-
-
Dim RRow2 As Integer
-
Dim Colomn2 As Integer
-
-
DataGrid1.Row = 0
-
DataGrid1.Col = Colomn2
-
For Colomn2 = 0 To DataGrid1.Columns.Count - 1
-
DataGrid1.Col = Colomn2
-
Debug.Print DataGrid1.Text
-
-
Next
-
-
RRow2 = 0
-
Colomn2 = 0
-
DataGrid1.Col = Colomn2
-
DataGrid1.Row = RRow2
-
-
If MsgBox(" Print to all?", vbOKCancel, "Print") = vbCancel Then
-
Exit Sub
-
End If
-
-
For RRow2 = 0 To rs2.RecordCount - 1
-
-
For Colomn2 = 0 To DataGrid1.Columns.Count - 1
-
DataGrid1.Col = Colomn2
-
Next
-
Text2.Text = DataGrid1.Text 'this line got error
-
-
LabelFormat2
-
-
rs2.MoveNext
-
Next
-
Printer.EndDoc
-
End Sub
-
-
Public Sub LabelFormat2()
-
-
Printer.Print "{D0391,0919,0360|}"
-
Printer.Print "{C|}"
-
Printer.Print "{D0391,0919,0360|}"
-
Printer.Print "{AX;+000,+000,+00|}"
-
Printer.Print "{AY;+00,0|}"
-
Printer.Print "{PC000;0136,0162,20,25,K,00,B|}"
-
Printer.Print "{RC00;" & Text2.Text & "|}"
-
Printer.Print "{XB00;0210,0200,A,3,03,0,0144,+0000000000,000,0,00|}"
-
Printer.Print "{RB00;>5>8>6" & Text2.Text & "|}"
-
Printer.Print "{XS;I,0001,0002C6200|}"
-
-
Printer.EndDoc
-
-
End Sub
-
6 6156
What line is the error on?
Run time error '6160' data access error -
Text2.Text = DataGrid1.Text 'this line got error
-
The DataGrid.Text property is not meaningful. It's not supposed to be used for anything.
but how to set value from datagrid1.text to my text1.text?
Datagrid.text has no value. You shouldn't ever want to use it for anything. Why you want to use it perplexes me. You must be trying to do something else and think you need to use datagrid.text but I have no idea what you're trying to do because you haven't said.
According to my research, there are a number of ways to access the data in a DataGrid control. One way is via the the .Text property of the DataGrid object which provides the (formatted) value of the current cell. Another is via the .Value property of the Column object. Please review the documentation for the DataGrid control, which will no doubt include samples.
I'd provide pointers to the relevant doco at MSDN, but for some reason trying to look something up there does a search of the entire web instead.
However, the runtime error 6160 is most likely caused by there being no data in the recordset. Try hitting Google for something like "runtime error 6160" and you'll find all sort of info.
Oh, one other thing. Are you aware that your Colomn2 loop doesn't do anything? My guess is that it should include the printing.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Rod |
last post by:
I have written an app which uses the ms data control for access 97
(dao350.dll)
if installed on windows 2000 the program runs perfectly,
but when installed on windows XP I get a "Data Access...
|
by: Mark Lewin |
last post by:
Hi all
I'm pulling my hair out over this particular problem and I'm wondering
whether you clever people can help.
I'm running the demo version of Access 2003, which I understand to be a...
|
by: david |
last post by:
i am having trouble with accessing the access database
using the oledb Jet drivers in the visual studio .net
environment. when i try to open the connection i recieve
the error message which says...
|
by: Michael |
last post by:
Hi Everyone,
Please help me on this one. I have the following function:
Public Sub SearchFor(ByRef mType As Module1.SearchForType, ByRef mValue As
String)
On Error GoTo Err_Handler
Dim Proc As...
|
by: Nilesh Pathak via .NET 247 |
last post by:
(Type your message here)
Sir ,I created project in asp.net in ver 7.0 without any problem, but when I used it in ver 7.1 there is a problem in dataaccessing. The error is :...
|
by: Tim |
last post by:
I am having the exact same problem as below. Has anyone found the solution
for this?
I believe the solutions lies somewhere in here:...
|
by: le0 |
last post by:
guys,
i have this problem when accessing a page in a server, this error always
appears
---------------------------------------------------------------------------------------------
Server...
|
by: bozzsystems |
last post by:
I have build an application that uses data reports in VB 6.0 connecting to Access2000 Database. The most interesting thing is that for the first time in my many years of programming am encountering...
|
by: Rick |
last post by:
I've moved code from a stage machine to the production machine, exact same
code works fine on the stage machine, they are both windows 2003 servers,
I'm getting a "Cannot generate SSPI context"...
|
by: Wernerh |
last post by:
Please could someone help with this problem. I have a datagrid that works perfectly back to a MS database. I have written the keycode functions for up, down, left and right keys in the datagrid. A...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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...
|
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,...
|
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...
|
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,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |