Access - Control Calendario

 
Vista:

Control Calendario

Publicado por ROny Rios (18 intervenciones) el 08/07/2008 19:41:31
Buen día si alguien me puede ayudar con esto, necesito poner el control de calendario para que un usuario ingrese dos fechas a unas cajas de texto ¿ como lo hago?, por favor y muchas gracias por la ayuda.

Saludos
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

RE:Control Calendario

Publicado por antperlop (15 intervenciones) el 08/07/2008 22:24:32
En un formulario

Private Sub BtnFECHA_Click()

Dim DateNew As Variant

On Error GoTo errorBtnFECHA

DateNew = GetDate(Me![FECHA])
If Me![FECHA] <> DateNew Or IsNull(Me![FECHA]) Then
Me![FECHA] = DateNew
End If
Me![FECHA].SetFocus

errorBtnFECHA:
Exit Sub

End Sub

Esto que sigue los metes en un modulo

Option Compare Database
Option Explicit

Function GetDate(Optional varDate As Variant) As Variant

Dim PasoValor As Boolean

PasoValor = False
If IsMissing(varDate) Then
varDate = Date
Else
If Not IsDate(varDate) Then
varDate = Date
Else
PasoValor = True
End If
End If

DoCmd.OpenForm FormName:="SUBFORM CALENDARIO", WindowMode:=acDialog, OpenArgs:=varDate

If IsLoaded("SUBFORM CALENDARIO") Then
GetDate = Forms("SUBFORM CALENDARIO").Calendar.Value
DoCmd.Close acForm, "SUBFORM CALENDARIO"
Else
If PasoValor Then
GetDate = varDate
Else
GetDate = Null
End If
End If

End Function

Function IsLoaded(ByVal strformName As String) As Integer

Const conObjStateClosed = 0
Const conDesignView = 0

IsLoaded = False
If SysCmd(acSysCmdGetObjectState, acForm, strformName) <> conObjStateClosed Then
If Forms(strformName).CurrentView <> conDesignView Then
IsLoaded = True
End If
End If

End Function
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

RE:Control Calendario

Publicado por RRios (1 intervención) el 08/07/2008 22:45:28
Gracias por la ayuda lo voy a probar ..
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