dataenvironment.rscommands
Publicado por Carlos mendoza (8 intervenciones) el 09/11/2007 15:52:10
Buenas que tal, mi situacion es la siguiente, estoy generando reportes especificos por medio del siguiente codigo, cuando solcito el primer reporte lo busca perfectamente pero cuando lo vuelvo a solicitar me indica que el objeto (DataEnvironment.rsCommand) esta abierto, mi pregunta es la siguiente ¿COMO DEMONIOS CIERRO EL CONDENADO OBJETO?, gracias ; )
A continuacion el codigo:
Private Sub cmdaceptar_Click()
If Optimprimir.Item(0).Value Then
rptgeneral.Show
Unload Me
ElseIf Optimprimir.Item(1) Then
If optopciones.Item(0) Then
cierre = True
SQL = "select * from expedientes where estado='" & cboopcion.Text & "'"
DataEnvironment2.rsCommand1.Open SQL
rptespest.Show
Unload Me
End If
If optopciones.Item(1) Then
SQL = "select * from expedientes where numexp='" & cbonumexp.Text & "'"
DataEnvironment3.rsCommand1.Open SQL
rptespnumexp.Show
Unload Me
End If
If optopciones.Item(2) Then
SQL = "select * from expedientes where fundo='" & cbofundo.Text & "'"
DataEnvironment4.rsCommand1.Open SQL
rptespfundo.Show
Unload Me
End If
If optopciones.Item(3) Then
SQL = "select * from expedientes where solicitante='" & cbosolici.Text & "'"
DataEnvironment5.rsCommand1.Open SQL
rptespsolici.Show
Unload Me
End If
End If
End Sub
A continuacion el codigo:
Private Sub cmdaceptar_Click()
If Optimprimir.Item(0).Value Then
rptgeneral.Show
Unload Me
ElseIf Optimprimir.Item(1) Then
If optopciones.Item(0) Then
cierre = True
SQL = "select * from expedientes where estado='" & cboopcion.Text & "'"
DataEnvironment2.rsCommand1.Open SQL
rptespest.Show
Unload Me
End If
If optopciones.Item(1) Then
SQL = "select * from expedientes where numexp='" & cbonumexp.Text & "'"
DataEnvironment3.rsCommand1.Open SQL
rptespnumexp.Show
Unload Me
End If
If optopciones.Item(2) Then
SQL = "select * from expedientes where fundo='" & cbofundo.Text & "'"
DataEnvironment4.rsCommand1.Open SQL
rptespfundo.Show
Unload Me
End If
If optopciones.Item(3) Then
SQL = "select * from expedientes where solicitante='" & cbosolici.Text & "'"
DataEnvironment5.rsCommand1.Open SQL
rptespsolici.Show
Unload Me
End If
End If
End Sub
Valora esta pregunta


0