Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 13th, 2005, 09:20 AM
msevilla msevilla is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 14 msevilla User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 52 sec
Reputation Power: 0
Problem printing the content of a datagrid

I need to send to print the registers in a datagrid. The registers displayed in the grid are selected with this function:

Private Sub Cmdmostrar_Click()
Dim strConn As String, db As New ADODB.Connection, query As String
numero = txtnumero.Text
fecha1 = Mid(CDate(DTPicker1.Value), 4, 3) & Mid(CDate(DTPicker1.Value), 1, 3) & Mid(CDate(DTPicker1.Value), 7, 4)
fecha2 = Mid(CDate(DTPicker2.Value), 4, 3) & Mid(CDate(DTPicker2.Value), 1, 3) & Mid(CDate(DTPicker2.Value), 7, 4)
Adodc1.RecordSource = "SELECT fecha, hora, usuario, codigo, estado FROM log WHERE fecha >= #" & fecha1 & "# AND fecha <= #" & fecha2 & "# AND movil = '710" & numero & "' OR movil = '100" & numero & "' ORDER BY fecha, hora "
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
DataGrid1.Refresh
End Sub

To print the register I created a button that displays a report in my dataenvironment, the function is this:

Private Sub cmdreporte_Click()
If x = False Then
DataEnvironment1.Log.Open
End If

DataEnvironment1.rsrptprint.Properties.Refresh
DataEnvironment1.rptprint numero, fecha1 <========== Here itīs the problem, 2 parameters

rep_print.Refresh
rep_print.Show

DataEnvironment1.rsrptprint.Close
DataEnvironment1.Log.Close

End Sub

In my data environment I established 2 parameters, numero and fecha1. If I try with 3 parameters (fecha2) I get an error saying there is not enough memory to this action, so I tried with just the 2 I mentioned but I get another error, Data type mismatch, and I have tried to declare my variables as data, string and variant, still the same error. The only parameter that works fine is number (as string), the 3 variables are global and I am running out of ideas. I wouldnīt like to use textboxes instead of DTPickers, unless there is no other way of course.

Maybe someone can help me out. Thanks for your time, I know itīs a very long thread but I wanted to be sure you guys got the idea.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Problem printing the content of a datagrid


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT