Ahora crea el nuevo almacen, pero no logro que me lea el almacen
Private Sub mnualmacen_Click(Index As Integer)
'Crear Nuevo Almacen
Dim File As String
Select Case Index
Case 0 ' Nuevo Almacen
File = InputBox("Elija el nombre del fichero para una nuevo Almacen (no debe existir).", "Nuevo Almacen", "Nuevo Almacen.dat")
If (Len(File) > 0) Then
File = AsegurarExtension(File, FILE_EXTENSION_FACTURA)
If (CrearNuevaFacturacion(File) = True) Then
Call Activar(True)
Else
Call Activar(False)
End If
Else
Call MsgBox("Proceso de creación de nuevo Almacen abortado. No se proporcionó un nombre", vbInformation, "Nuevo Almacen")
End If
Case 1 ' Leer Nuevo Almacen
Frmfile1.Show 1
If (Len(Frmfile1.File) > 0) Then
If (LeerFacturacion(App.Path & "\" & Frmfile1.File) = True) Then
Call Activar(True)
Else
Call Activar(False)
End If
End If
End Select
End Sub
Private Function CrearNuevaFacturacion(ByRef NombreFile As String) As Boolean
Dim Ruta As String
If (Abierto = True) Then Call Cerrar(Canal)
Ruta = (App.Path & "\" & NombreFile)
If (Abrir(Ruta, Canal, True) = True) Then
Call UpdateHeader(0, 0)
CrearNuevaFacturacion = True
Else
MsgBox "Parece que el fichero que intenta abrir ya existe, elija otro nombre (o bien ocurrió un error)..."
End If
End Function
Private Function LeerFacturacion(ByRef Ruta As String) As Boolean
Dim k As Integer
If (Abierto = True) Then Call Cerrar(Canal)
If (Abrir(Ruta, Canal) = True) Then
Get #Canal, 1, NumRegistros
Get #Canal, , AutoIncLote
Get #Canal, , AutoIncProducto
If (NumRegistros > 0) Then
With List1
.Clear
For k = 1 To NumRegistros
Get #Canal, , RegX
Call .AddItem(RegCompraToString(RegX, CHAR_SEP))
Next
' Ahora si se quiere puede leerse de nuevo el primer registro para transferirlo a los textbox...
.ListIndex = 0 ' para ello delegamos en el código que pondremos al listbox...
End With
End If
LeerFacturacion = True
End If
End Function
el problema esta en esta linea
Call .AddItem(RegCompraToString(RegX, CHAR_SEP))
error byref argument type mismatch en RegX
gracias