VERSION 5.00
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "msdatlst.ocx"
Begin VB.Form frmConfigAlmacen 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Configuracion de Almacen"
   ClientHeight    =   1050
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4605
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1050
   ScaleWidth      =   4605
   StartUpPosition =   1  'CenterOwner
   Begin MSDataListLib.DataCombo dcbAlmacen 
      Height          =   315
      Left            =   240
      TabIndex        =   2
      Top             =   360
      Width           =   2895
      _ExtentX        =   5106
      _ExtentY        =   556
      _Version        =   393216
      Style           =   2
      Text            =   "DataCombo1"
   End
   Begin VB.CommandButton cmdSalir 
      Cancel          =   -1  'True
      Caption         =   "&Salir"
      Height          =   360
      Left            =   3360
      TabIndex        =   1
      Top             =   600
      Width           =   975
   End
   Begin VB.CommandButton cmdGrabar 
      Caption         =   "&Aceptar"
      Height          =   375
      Left            =   3360
      TabIndex        =   0
      Top             =   120
      Width           =   975
   End
End
Attribute VB_Name = "frmConfigAlmacen"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public bAcceso As Boolean

Private Sub cmdGrabar_Click()
On Error GoTo MERROR

EscribirCfg "PARAMETROS", "Almacen", psArchivoCfg, dcbAlmacen.BoundText
kPAR_ALMACEN = dcbAlmacen.BoundText

Dim sSQL As String
sSQL = "UPDATE Producto set cAlmaCode='" & dcbAlmacen.BoundText & "'"
ADOCnn.Execute sSQL

MsgBox "Se actualizó el almacen por defecto para esta caja!", vbInformation + vbOKOnly

Unload Me


Exit Sub
MERROR:
MsgBox Err.Description

End Sub

Private Sub cmdsalir_Click()
  Unload Me
End Sub

Private Sub Form_Load()

  Dim sSQL As String
  Dim ADORS As ADODB.Recordset
   
  sSQL = " SELECT cCodAlmac, vDscAlmac FROM Almacen ORDER BY vDscAlmac "
  
  If Not oDBAdmin.EjecutarConsulta(ADOCnnSQL, sSQL, ADORS) Then GoTo Salir
  
   Set dcbAlmacen.RowSource = ADORS
        dcbAlmacen.BoundColumn = "cCodAlmac"
        dcbAlmacen.ListField = "vDscAlmac"
        
        dcbAlmacen.BoundText = kPAR_ALMACEN
        
   
          
  Exit Sub
  
Salir:
  MsgBox Err.Description, vbInformation + vbOKOnly
  Set ADORS = Nothing
  
End Sub
