![]() |
ayuda con error de tipos A continuacion les pongo un ejercicio de guille , el tema es que funciona bien todo menos la opcion de modificacion que es el Command3 , me da error de tipos en .Edad = Text5.Text y no entiendo por que da ese error ? Option Explicit Private Type tColega Nombre As String Apellidos As String Direccion As String Poblacion As String Edad As Integer Vecesquelemandounemailynocontesta As Long End Type Const MaxColegas = 50 Dim MisColegas(1 To MaxColegas) As tColega Dim Colega As Integer Private Sub Command1_Click() If Colega < MaxColegas Then Colega = Colega + 1 With MisColegas(Colega) .Nombre = Text1.Text .Apellidos = Text2.Text .Direccion = Text3.Text .Poblacion = Text4.Text .Edad = Text5.Text .Vecesquelemandounemailynocontesta = Text6.Text Text1.Text = "" Text2.Text = "" Text3.Text = "" Text4.Text = "" Text5.Text = "" Text6.Text = "" End With Caption = "Mis Colegas (" & Colega & " )" Else MsgBox "Atencion ya Tienes bastantes colegas" End If End Sub Private Sub Command2_Click() Dim i As Integer Dim sTmp As String For i = 1 To Colega With MisColegas(i) sTmp = .Nombre & vbCrLf & _ .Apellidos & vbCrLf & _ .Direccion & vbCrLf & _ .Poblacion & vbCrLf & _ .Edad & vbCrLf & _ .Vecesquelemandounemailynocontesta End With MsgBox "Datos del colega " & CStr(i) & vbCrLf & sTmp Next End Sub Private Sub Command3_Click() Dim ElColega As Integer ElColega = Text7.Text If ElColega > Colega Or ElColega < 1 Then MsgBox "El numero deber ser entre 1 y " & Colega Else With MisColegas(ElColega) .Nombre = Text1.Text .Apellidos = Text2.Text .Direccion = Text3.Text .Poblacion = Text4.Text .Edad = Text5.Text .Vecesquelemandounemailynocontesta = Text6.Text End With End If End Sub Private Sub Form_Load() Colega = 0 Text1.Text = "" Text2.Text = "" Text3.Text = "" Text4.Text = "" Text5.Text = "" Text6.Text = "" Text7.Text = "" Caption = "Mis Colegas" End Sub Gracias |
Escribe el valor numerico al igual que en el text6 y el text7... :arriba: |
no entiendo que me quieres decir que escriba el valor numerico , cuando le doy el alta escribo el valor numerico pero cuando lo traigo para modificar me dice que no coinciden los tipos |
por favor alguna idea ? sigo trabado con esto , gracias |
Y si pones: ElColega = Val(Text7.Text) |
| La zona horaria es GMT -6. Ahora son las 03:10. |
Desarrollado por vBulletin® Versión 3.8.7
Derechos de Autor ©2000 - 2026, Jelsoft Enterprises Ltd.