Excel - Problemas entre formularios

 
Vista:

Problemas entre formularios

Publicado por Claudio C. (43 intervenciones) el 28/07/2007 18:29:48
Buenos dias a todos.

Tengo un userform con el cual pretendo llenar un formato en excel.
En el userform se ingresan los datos que nos pide, cuenta con 4 botones (continuar, pausar, limpiar y cancelar).
Bien, la idea es q al momento de oprimir continuar, los datos ingresados en este formulario me los pase al siguiente formulario en los labels que representan a cada uno de los campos del formulario anterior.
Todo iba bien, capturaba los datos q se me pedian, y luego le daba en continuar y me pasaba los datos al siguiente formulario (use la propiedad caption de las etiquetas).
Pero despues de haber hecho el codigo initialize del segundo userform, ahora me marca un error al momento de darle continuar en el primer userform.

ALguna idea?
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Problemas entre formularios

Publicado por Claudio C. (43 intervenciones) el 28/07/2007 19:28:23
El error que me indica es el 13
Type mismatch
El error me lo genera cuando quiero asignarle un valor a la propiedad caption de los labels del siguiente userform.

He aqui el codigo del boton Continuar

Private Sub cmdContinue_Click()
Dim codCompany$, curCompany$
If Me.opt2030 = True Then
codCompany = "1130"
curCompany = "Empresa 1"
Else
If Me.opt2040 = True Then
codCompany = "1140"
curCompany = "Empresa 2"
Else
If Me.opt2060 = True Then
codCompany = "1160"
curCompany = "Empresa 3"
Else
If Me.opt2090 = True Then
codCompany = "1290"
curCompany = "Empresa 4"
End If
End If
End If
End If
frmVoucRecords.ciaNumber.Caption = codCompany
frmVoucRecords.Company.Caption = curCompany

If Me.optMXN = True Then
frmVoucRecords.lblCurr.Caption = "PESOS"
End If
If Me.optUSD = True Then
frmVoucRecords.lblCurr.Caption = "USD"
End If
If IsEmpty(Me.txtIVAInv.Value) = True Then
frmVoucRecords.lblInvIVA.Caption = 0
Else
frmVoucRecords.lblInvIVA.Caption = Me.txtIVAInv.Value
End If
frmVoucRecords.lblSupName.Caption = Me.cmbSupName.Value
frmVoucRecords.lblSupNumb.Caption = Me.Label4.Caption
frmVoucRecords.lblInvNumb.Caption = Me.txtInvNumb.Value
frmVoucRecords.lblInvDate.Caption = Me.txtInvDate.Value
frmVoucRecords.lblDateRec.Caption = Me.txtInvRec.Value
frmVoucRecords.lblInvAmt.Caption = Me.txtInvAmou.Value
frmVoucRecords.lblDocNumb.Caption = Me.txtDocNumb.Value
frmVoucRecords.lblBtcNumb.Caption = Me.txtBatchNumb.Value
frmVoucRecords.lblGLDate.Caption = Me.txtGLDate.Value
frmVoucRecords.lblPONumb.Caption = Me.txtPONumb.Value
frmVoucRecords.lblChkTT.Caption = Me.txtChkTT.Value
frmVoucRecords.lblDatePaid.Caption = Me.txtDatePaid.Value
Windows("02 - VOUCHERS.xls").Visible = True
Workbooks("02 - VOUCHERS.xls").Activate
Sheets(codCompany).Visible = True
Sheets(codCompany).Activate
frmVouchers.Hide
frmVoucRecords.Show
End Sub

Y aca esta el codigo del segundo userform

Private Sub UserForm_Initialize()
Dim Compa$
Dim supName$, supInvo$, supInvCur$
Dim supNumbr&, dcNumbr&, btcNumbr&, poNumbr&, chkNumbr&
Dim supDtRec As Date, supInvDat As Date, glDat As Date, dtPaid As Date
Compa = Me.ciaNumber.Caption
supName = Me.lblSupName.Caption
supInvo = Me.lblInvNumb.Caption
supInvCur = Me.lblCurr.Caption
supNumbr = Me.lblSupNumb.Caption
dcNumbr = Me.lblDocNumb.Caption
btcNumbr = Me.lblBtcNumb.Caption
poNumbr = Me.lblPONumb.Caption
chkNumbr = Me.lblChkTT.Caption
supDtRec = Me.lblDateRec.Caption
supInvDat = Me.lblInvDate.Caption
glDat = Me.lblGLDate.Caption
dtPaid = Me.lblDatePaid.Caption
With Me.txtBU
.Value = ""
.MaxLength = 9
.BackColor = RGB(255, 255, 201)
.ForeColor = RGB(0, 0, 136)
End With
With Me.txtAcc
.Value = ""
.BackColor = RGB(255, 255, 201)
.ForeColor = RGB(0, 0, 136)
End With
With Me.txtsubAcc
.Value = ""
.BackColor = RGB(255, 255, 201)
.ForeColor = RGB(0, 0, 136)
End With
With Me.txtSubL
.Value = ""
.BackColor = RGB(255, 255, 201)
.ForeColor = RGB(0, 0, 136)
End With
With Me.txtType
.Value = ""
.BackColor = RGB(255, 255, 201)
.ForeColor = RGB(0, 0, 136)
End With
With Me.txtEntry
.Value = ""
.BackColor = RGB(255, 255, 201)
.ForeColor = RGB(0, 0, 136)
End With
With Me.txtDescrip
.Value = ""
.BackColor = RGB(255, 255, 201)
.ForeColor = RGB(0, 0, 136)
End With
Windows("02 - VOUCHERS.xls").Visible = True
Workbooks("02 - VOUCHERS.xls").Activate
Select Case Compa
Case "2030"
Sheets("2030").Visible = True
ActiveWorkbook.Sheets("2030").Activate
ActiveWindow.DisplayGridlines = False
Case "2040"
Sheets("2040").Visible = True
ActiveWorkbook.Sheets("2040").Activate
ActiveWindow.DisplayGridlines = False
Case "2060"
Sheets("2060").Visible = True
ActiveWorkbook.Sheets("2060").Activate
ActiveWindow.DisplayGridlines = False
Case "2090"
Sheets("2090").Visible = True
ActiveWorkbook.Sheets("2090").Activate
ActiveWindow.DisplayGridlines = False
End Select
Range("C5").Value = supName
Range("G5").Value = supInvo
Range("I5").Value = supDtRec
Range("C6").Value = supNumbr
Range("G6").Value = supInvCur
Range("I6").Value = supInvDat
Range("C7").Value = dcNumbr
Range("G7").Value = btcNumbr
Range("I7").Value = glDat
Range("C8").Value = poNumbr
Range("G8").Value = chkNumbr
Range("I8").Value = dtPaid
Windows("02 - VOUCHERS.xls").Visible = False
Me.txtBU.SetFocus
End Sub


Gracias por sus comentarios
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar