problema con grilla
Publicado por Kenos (35 intervenciones) el 04/04/2008 19:30:50
tengo un formulario con una grilla, pero cuando quiero ver las propiedades de esta... no esta visible bajo ningun punto de vista... es posible crear una grilla por programación?
y un poco código es:
Dim lvalida As Boolean
Dim nPtoVta As String
Public Igual_UM As Integer
Const nColNV_Cod = 1
Const nColNV_Ayu = 2
Const nColNV_Des = 3
Public nColNV_Tot
Public nColNV_Uni
Public nColNV_STo
Public nColNV_Fam
Public nColNV_FilaNV
Public nColNV_NV
Public nColNV_IteFila
Const nColGD_Cod = 1
Const nColGD_Ayu = 2
Const nColGD_Des = 3
Const nColGD_UMIni = 4
Public nColGD_UMFin
Public nColGD_Tot
Public nColGD_Uni
Public nColGD_STo
Public nColGD_Fam
Public nColGD_Fila
Public nColGD_NV
Public nColGD_IteFilaNV
Public nColGD_FilaNV
Private Sub cmbBodega_Click()
VSP_Doc.ReDraw = False
Set rs = ExecSp("BP", "UnidadMedida_Bodega_Lista", GetDSN(1), True)
VSP_Doc.MaxCols = nColGD_UMIni
nColUmed = nColGD_UMIni - 1
ntoanchoUm = 0
Igual_UM = rs!Igual_UM
If Igual_UM = 1 Then
Do While Not rs.EOF
nColUmed = nColUmed + 1
ReDim Preserve aCodUmed(nColUmed - nColGD_UMIni + 1)
aCodUmed(nColUmed - nColGD_UMIni + 1) = rs!Cod_Umed
VSP_Doc.MaxCols = nColUmed
Call VSP_Doc.SetText(nColUmed, -1000, rs!Nom_Umed)
VSP_Doc.ColWidth(nColUmed) = 4.38: ntoanchoUm = ntoanchoUm + 4.38
VSP_Doc.Row = -1: VSP_Doc.Col = nColUmed
rs.MoveNext
Loop
difAncDes = 4.38 * 7 - ntoanchoUm
VSP_Doc.ColWidth(nColGD_Des) = 27.88 + difAncDes
VSP_Doc.MaxCols = nColUmed + 8
nColGD_UMFin = nColUmed
nColGD_Tot = nColUmed + 1: Call VSP_Doc.SetText(nColGD_Tot, -1000, "Total")
VSP_Doc.ColWidth(nColGD_Tot) = 4.5
Else
nColUmed = nColUmed + 1
Call VSP_Doc.SetText(nColUmed, -1000, "U.Med.")
VSP_Doc.ColWidth(nColUmed) = 7: ntoanchoUm = 7
difAncDes = 4.38 * 7 - ntoanchoUm
VSP_Doc.ColWidth(nColGD_Des) = 27.88 + difAncDes
VSP_Doc.MaxCols = nColUmed + 8
nColGD_UMFin = nColUmed
nColGD_Tot = nColUmed + 1: Call VSP_Doc.SetText(nColGD_Tot, -1000, "Cantidad")
VSP_Doc.ColWidth(nColGD_Tot) = 4.5
End If
nColGD_Uni = nColUmed + 2: Call VSP_Doc.SetText(nColGD_Uni, -1000, "Prec.Unit")
VSP_Doc.ColWidth(nColGD_Uni) = 6
nColGD_STo = nColUmed + 3: Call VSP_Doc.SetText(nColGD_STo, -1000, "Sub-Total")
VSP_Doc.ColWidth(nColGD_STo) = 8
VSP_Doc.BlockMode = True
VSP_Doc.Row = -1: VSP_Doc.Row2 = -1: VSP_Doc.Col = nColGD_UMIni: VSP_Doc.Col2 = nColUmed + 3
VSP_Doc.CellType = SS_CELL_TYPE_NUMBER
VSP_Doc.TypeTextOrient = SS_CELL_TEXTORIENT_HORIZONTAL
VSP_Doc.TypeEllipses = False
VSP_Doc.TypeHAlign = SS_CELL_H_ALIGN_RIGHT
VSP_Doc.TypeVAlign = SS_CELL_V_ALIGN_TOP
VSP_Doc.TypeNumberMin = "0.00"
VSP_Doc.TypeNumberMax = "100000000.00"
VSP_Doc.TypeNumberShowSep = True
VSP_Doc.TypeNegRed = False
VSP_Doc.TypeSpin = False
VSP_Doc.TypeSpinWrap = False
VSP_Doc.TypeSpinInc = "1.10"
VSP_Doc.TypeNumberDecPlaces = 0
VSP_Doc.TypeNumberLeadingZero = SS_LEADZERO_INTERNATIONAL
VSP_Doc.TypeNumberNegStyle = SS_NUMBER_NEGSTYLE_INTL
VSP_Doc.TypeNumberDecimal = ","
VSP_Doc.TypeNumberSeparator = "."
VSP_Doc.BlockMode = False
nColGD_Fam = nColUmed + 4: Call VSP_Doc.SetText(nColGD_Fam, -1000, "nColGD_Fam")
VSP_Doc.Col = nColGD_Fam: VSP_Doc.ColHidden = True
nColGD_Fila = nColUmed + 5: Call VSP_Doc.SetText(nColGD_Fila, -1000, "nColGD_Fila")
VSP_Doc.Col = nColGD_Fila: VSP_Doc.ColHidden = True
nColGD_NV = nColUmed + 6: Call VSP_Doc.SetText(nColGD_NV, -1000, "nColGD_NV")
VSP_Doc.Col = nColGD_NV: VSP_Doc.ColHidden = True
nColGD_IteFilaNV = nColUmed + 7: Call VSP_Doc.SetText(nColGD_IteFilaNV, -1000, "nColGD_IteFilaNV")
VSP_Doc.Col = nColGD_IteFilaNV: VSP_Doc.ColHidden = True
nColGD_FilaNV = nColUmed + 8: Call VSP_Doc.SetText(nColGD_FilaNV, -1000, "nColGD_FilaNV")
VSP_Doc.Col = nColGD_FilaNV: VSP_Doc.ColHidden = True
VSP_Doc.ReDraw = True
For i = nColGD_UMIni To nColGD_UMFin
Call VSP_Doc.GetText(i, -1000, cDato)
Call VSP_DetPend.GetText(i, -1000, cDato1)
If Not Trim(cDato1) = Trim(cDato) Then Cmdagrega.Enabled = False: Exit For
Next i
If i - 1 = nColGD_UMFin Then Cmdagrega.Enabled = True
End Sub
Private Sub Form_Load()
Me.Move 0, 0, 11580, 7620
Call CenterForm(Me)
lvalida = True
VSP_Doc.MaxRows = 25
Call VSP_Doc.DeleteRows(1, VSP_Doc.MaxRows): VSP_Doc.MaxRows = 25
Call VSP_DetPend.DeleteRows(1, VSP_DetPend.MaxRows): VSP_DetPend.MaxRows = 15
DTPFecha.Value = Date
DTPFecha.Enabled = False
CmdAyudaGD.Enabled = True
CmdAnulaDocto.Enabled = False
Call ProtegeVS_grilla(VSP_Doc)
cmbBodega.Clear
cmbBodega.AddItem "Punto Venta:" & Trim(Nombre_Local) & Space(100) & "^" & Trim(cCodPtoVta_Local)
cmbBodega.ListIndex = 0
Set rs = ExecSp("BP", "UnidadMedida_Bodega_Lista", GetDSN(1), True)
VSP_DetPend.MaxCols = nColGD_UMIni
nColUmed = nColGD_UMIni - 1
ntoanchoUm = 0
Do While Not rs.EOF
nColUmed = nColUmed + 1
VSP_DetPend.MaxCols = nColUmed
Call VSP_DetPend.SetText(nColUmed, -1000, rs!Nom_Umed)
VSP_DetPend.ColWidth(nColUmed) = 4.38: ntoanchoUm = ntoanchoUm + 4.38
rs.MoveNext
Loop
VSP_DetPend.MaxCols = nColUmed + 7
difAncDes = 4.38 * 7 - ntoanchoUm
VSP_DetPend.ColWidth(nColNV_Des) = 16 + difAncDes
nColNV_Tot = nColUmed + 1: Call VSP_DetPend.SetText(nColNV_Tot, -1000, "Total")
VSP_DetPend.ColWidth(nColNV_Tot) = 4.5
nColNV_Uni = nColUmed + 2: Call VSP_DetPend.SetText(nColNV_Uni, -1000, "Prec.Unit")
VSP_DetPend.ColWidth(nColNV_Uni) = 6
nColNV_STo = nColUmed + 3: Call VSP_DetPend.SetText(nColNV_STo, -1000, "Sub-Total")
VSP_DetPend.ColWidth(nColNV_STo) = 8
VSP_DetPend.BlockMode = True
VSP_DetPend.Row = -1: VSP_DetPend.Row2 = -1: VSP_DetPend.Col = nColGD_UMIni: VSP_DetPend.Col2 = nColUmed + 3
VSP_DetPend.CellType = SS_CELL_TYPE_NUMBER
VSP_DetPend.TypeTextOrient = SS_CELL_TEXTORIENT_HORIZONTAL
VSP_DetPend.TypeEllipses = False
VSP_DetPend.TypeHAlign = SS_CELL_H_ALIGN_RIGHT
VSP_DetPend.TypeVAlign = SS_CELL_V_ALIGN_TOP
VSP_DetPend.TypeNumberMin = "0.00"
VSP_DetPend.TypeNumberMax = "100000000.00"
VSP_DetPend.TypeNumberShowSep = True
VSP_DetPend.TypeNegRed = False
VSP_DetPend.TypeSpin = False
VSP_DetPend.TypeSpinWrap = False
VSP_DetPend.TypeSpinInc = "1.10"
VSP_DetPend.TypeNumberDecPlaces = 0
VSP_DetPend.TypeNumberLeadingZero = SS_LEADZERO_INTERNATIONAL
VSP_DetPend.TypeNumberNegStyle = SS_NUMBER_NEGSTYLE_INTL
VSP_DetPend.TypeNumberDecimal = ","
VSP_DetPend.TypeNumberSeparator = "."
VSP_DetPend.BlockMode = False
nColNV_Fam = nColUmed + 4: Call VSP_DetPend.SetText(nColNV_Fam, -1000, "nColGD_Fam")
VSP_DetPend.Col = nColNV_Fam: VSP_DetPend.ColHidden = True
nColNV_FilaNV = nColUmed + 5: Call VSP_DetPend.SetText(nColNV_Fam, -1000, "nColGD_Fam")
VSP_DetPend.Col = nColNV_FilaNV: VSP_DetPend.ColHidden = True
nColNV_NV = nColUmed + 6: Call VSP_DetPend.SetText(nColNV_Fam, -1000, "nColGD_Fam")
VSP_DetPend.Col = nColNV_NV: VSP_DetPend.ColHidden = True
nColNV_IteFila = nColUmed + 7: Call VSP_DetPend.SetText(nColNV_Fam, -1000, "nColGD_Fam")
VSP_DetPend.Col = nColNV_IteFila: VSP_DetPend.ColHidden = True
Call cmbBodega_Click
End Sub
no se cómo puedo ver esa grilla si existe... ya que me da que unas variables no estan definidas... y el sistema está funcionando hace mucho tiempo sinproblemas.
y un poco código es:
Dim lvalida As Boolean
Dim nPtoVta As String
Public Igual_UM As Integer
Const nColNV_Cod = 1
Const nColNV_Ayu = 2
Const nColNV_Des = 3
Public nColNV_Tot
Public nColNV_Uni
Public nColNV_STo
Public nColNV_Fam
Public nColNV_FilaNV
Public nColNV_NV
Public nColNV_IteFila
Const nColGD_Cod = 1
Const nColGD_Ayu = 2
Const nColGD_Des = 3
Const nColGD_UMIni = 4
Public nColGD_UMFin
Public nColGD_Tot
Public nColGD_Uni
Public nColGD_STo
Public nColGD_Fam
Public nColGD_Fila
Public nColGD_NV
Public nColGD_IteFilaNV
Public nColGD_FilaNV
Private Sub cmbBodega_Click()
VSP_Doc.ReDraw = False
Set rs = ExecSp("BP", "UnidadMedida_Bodega_Lista", GetDSN(1), True)
VSP_Doc.MaxCols = nColGD_UMIni
nColUmed = nColGD_UMIni - 1
ntoanchoUm = 0
Igual_UM = rs!Igual_UM
If Igual_UM = 1 Then
Do While Not rs.EOF
nColUmed = nColUmed + 1
ReDim Preserve aCodUmed(nColUmed - nColGD_UMIni + 1)
aCodUmed(nColUmed - nColGD_UMIni + 1) = rs!Cod_Umed
VSP_Doc.MaxCols = nColUmed
Call VSP_Doc.SetText(nColUmed, -1000, rs!Nom_Umed)
VSP_Doc.ColWidth(nColUmed) = 4.38: ntoanchoUm = ntoanchoUm + 4.38
VSP_Doc.Row = -1: VSP_Doc.Col = nColUmed
rs.MoveNext
Loop
difAncDes = 4.38 * 7 - ntoanchoUm
VSP_Doc.ColWidth(nColGD_Des) = 27.88 + difAncDes
VSP_Doc.MaxCols = nColUmed + 8
nColGD_UMFin = nColUmed
nColGD_Tot = nColUmed + 1: Call VSP_Doc.SetText(nColGD_Tot, -1000, "Total")
VSP_Doc.ColWidth(nColGD_Tot) = 4.5
Else
nColUmed = nColUmed + 1
Call VSP_Doc.SetText(nColUmed, -1000, "U.Med.")
VSP_Doc.ColWidth(nColUmed) = 7: ntoanchoUm = 7
difAncDes = 4.38 * 7 - ntoanchoUm
VSP_Doc.ColWidth(nColGD_Des) = 27.88 + difAncDes
VSP_Doc.MaxCols = nColUmed + 8
nColGD_UMFin = nColUmed
nColGD_Tot = nColUmed + 1: Call VSP_Doc.SetText(nColGD_Tot, -1000, "Cantidad")
VSP_Doc.ColWidth(nColGD_Tot) = 4.5
End If
nColGD_Uni = nColUmed + 2: Call VSP_Doc.SetText(nColGD_Uni, -1000, "Prec.Unit")
VSP_Doc.ColWidth(nColGD_Uni) = 6
nColGD_STo = nColUmed + 3: Call VSP_Doc.SetText(nColGD_STo, -1000, "Sub-Total")
VSP_Doc.ColWidth(nColGD_STo) = 8
VSP_Doc.BlockMode = True
VSP_Doc.Row = -1: VSP_Doc.Row2 = -1: VSP_Doc.Col = nColGD_UMIni: VSP_Doc.Col2 = nColUmed + 3
VSP_Doc.CellType = SS_CELL_TYPE_NUMBER
VSP_Doc.TypeTextOrient = SS_CELL_TEXTORIENT_HORIZONTAL
VSP_Doc.TypeEllipses = False
VSP_Doc.TypeHAlign = SS_CELL_H_ALIGN_RIGHT
VSP_Doc.TypeVAlign = SS_CELL_V_ALIGN_TOP
VSP_Doc.TypeNumberMin = "0.00"
VSP_Doc.TypeNumberMax = "100000000.00"
VSP_Doc.TypeNumberShowSep = True
VSP_Doc.TypeNegRed = False
VSP_Doc.TypeSpin = False
VSP_Doc.TypeSpinWrap = False
VSP_Doc.TypeSpinInc = "1.10"
VSP_Doc.TypeNumberDecPlaces = 0
VSP_Doc.TypeNumberLeadingZero = SS_LEADZERO_INTERNATIONAL
VSP_Doc.TypeNumberNegStyle = SS_NUMBER_NEGSTYLE_INTL
VSP_Doc.TypeNumberDecimal = ","
VSP_Doc.TypeNumberSeparator = "."
VSP_Doc.BlockMode = False
nColGD_Fam = nColUmed + 4: Call VSP_Doc.SetText(nColGD_Fam, -1000, "nColGD_Fam")
VSP_Doc.Col = nColGD_Fam: VSP_Doc.ColHidden = True
nColGD_Fila = nColUmed + 5: Call VSP_Doc.SetText(nColGD_Fila, -1000, "nColGD_Fila")
VSP_Doc.Col = nColGD_Fila: VSP_Doc.ColHidden = True
nColGD_NV = nColUmed + 6: Call VSP_Doc.SetText(nColGD_NV, -1000, "nColGD_NV")
VSP_Doc.Col = nColGD_NV: VSP_Doc.ColHidden = True
nColGD_IteFilaNV = nColUmed + 7: Call VSP_Doc.SetText(nColGD_IteFilaNV, -1000, "nColGD_IteFilaNV")
VSP_Doc.Col = nColGD_IteFilaNV: VSP_Doc.ColHidden = True
nColGD_FilaNV = nColUmed + 8: Call VSP_Doc.SetText(nColGD_FilaNV, -1000, "nColGD_FilaNV")
VSP_Doc.Col = nColGD_FilaNV: VSP_Doc.ColHidden = True
VSP_Doc.ReDraw = True
For i = nColGD_UMIni To nColGD_UMFin
Call VSP_Doc.GetText(i, -1000, cDato)
Call VSP_DetPend.GetText(i, -1000, cDato1)
If Not Trim(cDato1) = Trim(cDato) Then Cmdagrega.Enabled = False: Exit For
Next i
If i - 1 = nColGD_UMFin Then Cmdagrega.Enabled = True
End Sub
Private Sub Form_Load()
Me.Move 0, 0, 11580, 7620
Call CenterForm(Me)
lvalida = True
VSP_Doc.MaxRows = 25
Call VSP_Doc.DeleteRows(1, VSP_Doc.MaxRows): VSP_Doc.MaxRows = 25
Call VSP_DetPend.DeleteRows(1, VSP_DetPend.MaxRows): VSP_DetPend.MaxRows = 15
DTPFecha.Value = Date
DTPFecha.Enabled = False
CmdAyudaGD.Enabled = True
CmdAnulaDocto.Enabled = False
Call ProtegeVS_grilla(VSP_Doc)
cmbBodega.Clear
cmbBodega.AddItem "Punto Venta:" & Trim(Nombre_Local) & Space(100) & "^" & Trim(cCodPtoVta_Local)
cmbBodega.ListIndex = 0
Set rs = ExecSp("BP", "UnidadMedida_Bodega_Lista", GetDSN(1), True)
VSP_DetPend.MaxCols = nColGD_UMIni
nColUmed = nColGD_UMIni - 1
ntoanchoUm = 0
Do While Not rs.EOF
nColUmed = nColUmed + 1
VSP_DetPend.MaxCols = nColUmed
Call VSP_DetPend.SetText(nColUmed, -1000, rs!Nom_Umed)
VSP_DetPend.ColWidth(nColUmed) = 4.38: ntoanchoUm = ntoanchoUm + 4.38
rs.MoveNext
Loop
VSP_DetPend.MaxCols = nColUmed + 7
difAncDes = 4.38 * 7 - ntoanchoUm
VSP_DetPend.ColWidth(nColNV_Des) = 16 + difAncDes
nColNV_Tot = nColUmed + 1: Call VSP_DetPend.SetText(nColNV_Tot, -1000, "Total")
VSP_DetPend.ColWidth(nColNV_Tot) = 4.5
nColNV_Uni = nColUmed + 2: Call VSP_DetPend.SetText(nColNV_Uni, -1000, "Prec.Unit")
VSP_DetPend.ColWidth(nColNV_Uni) = 6
nColNV_STo = nColUmed + 3: Call VSP_DetPend.SetText(nColNV_STo, -1000, "Sub-Total")
VSP_DetPend.ColWidth(nColNV_STo) = 8
VSP_DetPend.BlockMode = True
VSP_DetPend.Row = -1: VSP_DetPend.Row2 = -1: VSP_DetPend.Col = nColGD_UMIni: VSP_DetPend.Col2 = nColUmed + 3
VSP_DetPend.CellType = SS_CELL_TYPE_NUMBER
VSP_DetPend.TypeTextOrient = SS_CELL_TEXTORIENT_HORIZONTAL
VSP_DetPend.TypeEllipses = False
VSP_DetPend.TypeHAlign = SS_CELL_H_ALIGN_RIGHT
VSP_DetPend.TypeVAlign = SS_CELL_V_ALIGN_TOP
VSP_DetPend.TypeNumberMin = "0.00"
VSP_DetPend.TypeNumberMax = "100000000.00"
VSP_DetPend.TypeNumberShowSep = True
VSP_DetPend.TypeNegRed = False
VSP_DetPend.TypeSpin = False
VSP_DetPend.TypeSpinWrap = False
VSP_DetPend.TypeSpinInc = "1.10"
VSP_DetPend.TypeNumberDecPlaces = 0
VSP_DetPend.TypeNumberLeadingZero = SS_LEADZERO_INTERNATIONAL
VSP_DetPend.TypeNumberNegStyle = SS_NUMBER_NEGSTYLE_INTL
VSP_DetPend.TypeNumberDecimal = ","
VSP_DetPend.TypeNumberSeparator = "."
VSP_DetPend.BlockMode = False
nColNV_Fam = nColUmed + 4: Call VSP_DetPend.SetText(nColNV_Fam, -1000, "nColGD_Fam")
VSP_DetPend.Col = nColNV_Fam: VSP_DetPend.ColHidden = True
nColNV_FilaNV = nColUmed + 5: Call VSP_DetPend.SetText(nColNV_Fam, -1000, "nColGD_Fam")
VSP_DetPend.Col = nColNV_FilaNV: VSP_DetPend.ColHidden = True
nColNV_NV = nColUmed + 6: Call VSP_DetPend.SetText(nColNV_Fam, -1000, "nColGD_Fam")
VSP_DetPend.Col = nColNV_NV: VSP_DetPend.ColHidden = True
nColNV_IteFila = nColUmed + 7: Call VSP_DetPend.SetText(nColNV_Fam, -1000, "nColGD_Fam")
VSP_DetPend.Col = nColNV_IteFila: VSP_DetPend.ColHidden = True
Call cmbBodega_Click
End Sub
no se cómo puedo ver esa grilla si existe... ya que me da que unas variables no estan definidas... y el sistema está funcionando hace mucho tiempo sinproblemas.
Valora esta pregunta


0