saludos amigos, me pueden ayudar con un problema de programacion con visual 6, me sale estos errores
Dim condi, proc As String
Dim fech As Date
Dim sw As Integer
Private Sub grabar()
Set rs1 = New ADODB.Recordset
a = "'" & Form1.Text4.Text & "','" & Form1.Text1.Text & "',"
a1 = "'" & Form1.Text2.Text & "','" & Form1.Text3.Text & "',"
a2 = "'" & Form1.Text5.Text & "','" & Form1.Text7.Text & "',"
a3 = "'" & sex & "','" & tipo & "'"
s = "(" & a & a1 & a2 & a3 & ")"
s3 = "insert into paciente (ced,ape,nom,hist,afi,edad,sex,tipo) values " & s
rs1.Open s3, cn, adOpenStatic (este dialogo me sale con amarillo ayuda por favor)
'MsgBox "Se Grabó con exito los datos", vbDefaultButton1 + vbInformation, "Control De Datos"
's3 = "insert into paciente (ced,ape,nom,hist,afi,edad,sex,tipo,fechai,horai,tiss,apache,ist,saps,glasw) values " & s
End Sub
Private Sub grabarin()
Set rs1 = New ADODB.Recordset
If sw = 1 Then
proc = Trim(Text1.Text)
End If
a = "'" & Form1.Text4.Text & "',"
a1 = "'" & Form1.DTPicker1.Value & "','" & Form1.DTPicker2.Value & "',"
a2 = "'" & Form1.Text9.Text & "','" & Form1.Text6.Text & "','" & proc & "'"
s = "(" & a & a1 & a2 & ")"
s3 = "insert into ingreso (ced,fechai,horai,ist,aut_ing,proce) values " & s
rs1.Open s3, cn, adOpenStatic
'MsgBox "Se Grabó con exito los datos", vbDefaultButton1 + vbInformation, "Control De Datos"
's3 = "insert into paciente (ced,ape,nom,hist,afi,edad,sex,tipo,fechai,horai,tiss,apache,ist,saps,glasw) values " & s
End Sub
Private Sub Command1_Click()
Form1.Show
End Sub
Private Sub Command2_Click()
If gh = 0 Then
grabar
End If
grabarin
grabar1
grabar2
grabar6
MsgBox "Se Grabó con exito los datos", vbDefaultButton1 + vbInformation, "Control De Datos"
End Sub
Private Sub Calculo()
Dim f, f1, h, h1 As Date
f = Form1.DTPicker1.Value
f1 = fechas.Value
h = Form1.DTPicker2.Value
h1 = horas.Value
Label35.Caption = DateDiff("d", f, f1)
End Sub
Private Sub Command3_Click()
grabar3
End Sub
Private Sub Command4_Click()
Form2.Hide
Form1.Hide
Principal.Show
End Sub
Private Sub Check1_Click()
If Check1.Value = 1 Then
condi = "V"
Check2.Value = 0
Check3.Value = 0
Text12.SetFocus
End If
End Sub
Private Sub Check2_Click()
If Check2.Value = 1 Then
condi = "M"
Check1.Value = 0
Check3.Value = 0
Text12.SetFocus
End If
End Sub
Private Sub Check3_Click()
If Check3.Value = 1 Then
condi = "T"
Check2.Value = 0
Check1.Value = 0
Text12.SetFocus
End If
End Sub
Private Sub ChEsp_Click(Index As Integer)
a = ChEsp(Index).Index
Select Case a
Case 0
If ChEsp(0).Value = 1 Then
ChEsp(2).Enabled = False
ChEsp(4).Enabled = False
ChEsp(6).Enabled = False
ChEsp(7).Enabled = False
ChEsp(
.Enabled = False
ChEsp(2).Value = 0
ChEsp(4).Value = 0
ChEsp(6).Value = 0
ChEsp(7).Value = 0
ChEsp(
.Value = 0
Else
ChEsp(2).Enabled = True
ChEsp(4).Enabled = True
ChEsp(6).Enabled = True
ChEsp(7).Enabled = True
ChEsp(
.Enabled = True
ChEsp(2).Value = 0
ChEsp(4).Value = 0
End If
Case 1
If ChEsp(1).Value = 1 Then
ChEsp(3).Enabled = False
ChEsp(5).Enabled = False
ChEsp(3).Value = 0
ChEsp(5).Value = 0
Text13.Enabled = False
Text13 = ""
Else
ChEsp(3).Enabled = True
ChEsp(5).Enabled = True
ChEsp(3).Value = 0
ChEsp(5).Value = 0
Text13.Enabled = True
Text13 = ""
End If
Case 2
If ChEsp(2).Value = 1 Then
ChEsp(0).Enabled = False
ChEsp(4).Enabled = False
ChEsp(0).Value = 0
ChEsp(4).Value = 0
Else
ChEsp(0).Enabled = True
ChEsp(4).Enabled = True
ChEsp(0).Value = 0
ChEsp(4).Value = 0
ChEsp(6).Value = 0
ChEsp(7).Value = 0
ChEsp(
.Value = 0
End If
Case 3
If ChEsp(3).Value = 1 Then
ChEsp(1).Enabled = False
ChEsp(5).Enabled = False
Text13.Enabled = False
ChEsp(1).Value = 0
ChEsp(5).Value = 0
Text13 = ""
Else
ChEsp(1).Enabled = True
ChEsp(5).Enabled = True
ChEsp(1).Value = 0
ChEsp(5).Value = 0
Text13.Enabled = True
Text13 = ""
End If
Case 4
If ChEsp(4).Value = 1 Then
ChEsp(0).Enabled = False
ChEsp(2).Enabled = False
ChEsp(6).Enabled = False
ChEsp(7).Enabled = False
ChEsp(
.Enabled = False
ChEsp(0).Value = 0
ChEsp(2).Value = 0
Else
ChEsp(0).Enabled = True
ChEsp(2).Enabled = True
ChEsp(6).Enabled = True
ChEsp(7).Enabled = True
ChEsp(
.Enabled = True
ChEsp(0).Value = 0
ChEsp(2).Value = 0
ChEsp(6).Value = 0
ChEsp(7).Value = 0
ChEsp(
.Value = 0
End If
Case 5
If ChEsp(5).Value = 1 Then
ChEsp(3).Enabled = False
ChEsp(1).Enabled = False
ChEsp(3).Value = 0
ChEsp(1).Value = 0
Text13.SetFocus
Else
ChEsp(3).Enabled = True
ChEsp(1).Enabled = True
ChEsp(3).Value = 0
ChEsp(1).Value = 0
Text13 = ""
End If
Case 6
If ChEsp(6).Value = 1 Then
ChEsp(7).Value = 0
ChEsp(
.Value = 0
End If
Case 7
If ChEsp(7).Value = 1 Then
ChEsp(6).Value = 0
ChEsp(
.Value = 0
End If
Case 8
If ChEsp(
.Value = 1 Then
ChEsp(6).Value = 0
ChEsp(7).Value = 0
End If
End Select
End Sub
Private Sub ChT_Click(Index As Integer)
Dim a As Integer
a = ChT(Index).Index
sw = 0
Select Case a
Case 0
If ChT(0).Value = 1 Then
proc = "Quirófano"
ChT(1).Value = 0
ChT(2).Value = 0
ChT(3).Value = 0
End If
Case 1
If ChT(1).Value = 1 Then
proc = "Urgencias"
ChT(0).Value = 0
ChT(2).Value = 0
ChT(3).Value = 0
End If
Case 2
If ChT(2).Value = 1 Then
proc = "Hospitalización"
ChT(1).Value = 0
ChT(0).Value = 0
ChT(3).Value = 0
End If
Case 3
If ChT(3).Value = 1 Then
Text1.SetFocus
ChT(1).Value = 0
ChT(0).Value = 0
ChT(2).Value = 0
sw = 1
Else
Text1 = ""
sw = 0
End If
End Select
End Sub
Private Sub grabar1()
Set rs1 = New ADODB.Recordset
For i = 0 To 50
If CheckI(i).Value = 1 Then
a = "'" & Form1.Text4.Text & "','" & i & "',"
a1 = "'" & LbD(i).Caption & "','" & Form1.DTPicker1.Value & "'"
s = "(" & a & a1 & ")"
s3 = "insert into diagnostico (ced,dg_i,nom_i,fecha) values " & s
rs1.Open s3, cn, adOpenStatic
End If
Next i
For i = 0 To 39
If CheckU(i).Value = 1 Then
a = "'" & Form1.Text4.Text & "','" & i & "',"
a1 = "'" & LbD(i).Caption & "','" & Form1.DTPicker1.Value & "'"
s = "(" & a & a1 & ")"
s3 = "insert into diagnosticou (ced,dg_u,nom_u,fecha) values " & s
rs1.Open s3, cn, adOpenStatic
End If
Next i
End Sub
Private Sub grabar2()
Set rs1 = New ADODB.Recordset
For i = 0 To 38
If CheckP(i).Value = 1 Then
a = "'" & Form1.Text4.Text & "','" & i & "',"
a1 = "'" & LbP(i).Caption & "','" & Form1.DTPicker1.Value & "'"
s = "(" & a & a1 & ")"
s3 = "insert into procedimiento (ced,cod_p,nom_pro,fecha) values " & s
rs1.Open s3, cn, adOpenStatic
End If
Next i
For i = 0 To 38
If CheckPi(i).Value = 1 Then
a = "'" & Form1.Text4.Text & "','" & i & "',"
a1 = "'" & LbP(i).Caption & "','" & Form1.DTPicker1.Value & "'"
s = "(" & a & a1 & ")"
s3 = "insert into procedimientoi (ced,cod_pi,nom_proi,fecha) values " & s
rs1.Open s3, cn, adOpenStatic
End If
Next i
'MsgBox "Se Grabó con exito los datos", vbDefaultButton1 + vbInformation, "Control De Datos"
End Sub
Private Sub grabar3()
Set rs1 = New ADODB.Recordset
a = "'" & Form1.Text4.Text & "','" & fechas.Value & "',"
a1 = "'" & horas.Value & "','" & Val(Label35.Caption) & "',"
a2 = "'" & condi & "','" & Text4.Text & "',"
a3 = "'" & Text5.Text & "','" & Text6.Text & "',"
a4 = "'" & Text7.Text & "','" & Text8.Text & "',"
a5 = "'" & Text9.Text & "','" & Text12.Text & "',"
a6 = "'" & Text11.Text & "','" & Text10.Text & "',"
a7 = "'" & Text3.Text & "','" & Text2.Text & "',"
a8 = "'" & Form1.DTPicker1.Value & "'"
s = "(" & a & a1 & a2 & a3 & a4 & a5 & a6 & a7 & a8 & ")"
s3 = "insert into permanencia (ced,fechas,hora,td,cod_f,cpis,vmi,vmni,tiss,apa,egw,transf,resp_sa,tissi,apai,egwi,fechai) values " & s
rs1.Open s3, cn, adOpenStatic
MsgBox "Se Grabó con exito los datos", vbDefaultButton1 + vbInformation, "Control De Datos"
s3 = "UPDATE ingreso SET salida='1' WHERE ced='" & Form1.Text4.Text & "' And fechai='" & Form1.DTPicker1.Value & "'"
rs1.Open s3, cn, adOpenStatic
End Sub
Private Sub grabar6()
Set rs1 = New ADODB.Recordset
For i = 0 To 8
If ChEsp(i).Value = 1 Then
a = "'" & Form1.Text4.Text & "','" & i & "',"
a1 = "'" & LbE(i).Caption & "','" & Form1.DTPicker1.Value & "'"
s = "(" & a & a1 & ")"
s3 = "insert into especialidad (ced,num,esp,fecha) values " & s
rs1.Open s3, cn, adOpenStatic
End If
Next i
' MsgBox "Se Grabó con exito los datos", vbDefaultButton1 + vbInformation, "Control De Datos"
End Sub
Private Sub fechas_CloseUp()
horas.SetFocus
End Sub
Private Sub fechas_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
horas.SetFocus
End If
End Sub
Private Sub Form_Activate()
For i = 0 To 3
ChT(i).Value = 0
Next i
Text1 = ""
Text13 = ""
For i = 0 To 8
ChEsp(i).Value = 0
Next i
For i = 0 To 50
CheckI(i).Value = 0
CheckU(i).Value = 0
Next i
For i = 0 To 39
CheckP(i).Value = 0
CheckPi(i).Value = 0
Next i
fechas.Value = Date
horas.Value = Date
Label35 = ""
Text12 = ""
Text11 = ""
Text10 = ""
Text3 = ""
Text2 = ""
Text5 = ""
Text6 = ""
Text7 = ""
Text8 = ""
Text9 = ""
Text4 = ""
Check1.Value = 0
Check2.Value = 0
Check3.Value = 0
End Sub
Private Sub horas_GotFocus()
Calculo
End Sub
Private Sub Text10_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text3.SetFocus
Else
control2 (KeyAscii)
If a = 0 Then
KeyAscii = 0
End If
End If
End Sub
Private Sub Text11_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text10.SetFocus
End If
End Sub
Private Sub Text12_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text11.SetFocus
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text5.SetFocus
Else
control2 (KeyAscii)
If a = 0 Then
KeyAscii = 0
End If
End If
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
Else
control2 (KeyAscii)
If a = 0 Then
KeyAscii = 0
End If
End If
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Command3.SetFocus
Else
control2 (KeyAscii)
If a = 0 Then
KeyAscii = 0
End If
End If
End Sub
Private Sub Text5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text6.SetFocus
Else
control2 (KeyAscii)
If a = 0 Then
KeyAscii = 0
End If
End If
End Sub
Private Sub Text6_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text7.SetFocus
Else
control2 (KeyAscii)
If a = 0 Then
KeyAscii = 0
End If
End If
End Sub
Private Sub Text7_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text8.SetFocus
Else
control2 (KeyAscii)
If a = 0 Then
KeyAscii = 0
End If
End If
End Sub
Private Sub Text8_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text9.SetFocus
Else
control2 (KeyAscii)
If a = 0 Then
KeyAscii = 0
End If
End If
End Sub
Private Sub Text9_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text4.SetFocus
Else
control2 (KeyAscii)
If a = 0 Then
KeyAscii = 0
End If
End If
End Sub