🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.bd.ms-access
Article #116

Re: FORMULARIOS

#116
From: namor
Date: Tue, 23 Oct 2007 11:22
41 lines
2818 bytes
On 22 Set, 16:15, mllui...@gmail.com wrote:
> Hola,
> Me gustaría saber, cómo tengo que hacer para que cuando filtre en un
> formulario y no se encuentre el dato, no desaparezcan todos los datos
> y quede la pantalla vacía, sin etiquetas ni cuadros de texto, es decir
> que pueda volver a filtrar sin tener que quitar el autofiltro para que
> aparezcan los datos de nuevo. Espero haberme explicado.
> Gracias,
> Linsi


Hay que trabajar en dos eventos.
En el Form_Current se cuentan los registros, pero solo si ha sido
puesto un filtro, entonces hay que añadir una variable para saber si
hay o no hay filtros. Si no hay registros se quita el filtro, y si
quieres puedes también avisar al usuario.
Aquí hay un ejemplo:

Option Compare Database
Option Explicit

Dim hayfiltro As Boolean

Private Sub Form_ApplyFilter(Cancel As Integer, ApplyType As Integer)
    hayfiltro = True
End Sub

Private Sub Form_Current()
    If hayfiltro And Me.RecordsetClone.RecordCount = 0 Then
        MsgBox "Non hay registros para ese filtro."
        Me.Filter = ""
        Me.FilterOn = False
        hayfiltro = False
    End If
End Sub

No conozco bien al español, todavía estoy estudiandolo. Si encuentran
errores de qualquier tipo en mis mensajes le agradezco por enviarme
las correcciónes por email.
Hola.
-Marco-
Technical Details
Message-ID: <1193138578.064015.247280@k35g2000prh.googlegroups.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!k35g2000prh.googlegroups.com!not-for-mail
References: <1190470527.268500.175230@w3g2000hsg.googlegroups.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 111a5a,9f253b2d85f96968
X-Google-Attributes: gid111a5a,public,usenet
X-Google-Language: SPANISH,ASCII
Path: arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!k35g2000prh.googlegroups.com!not-for-mail
From:  namor <marco.pizzamiglio@gmail.com>
Newsgroups: es.comp.bd.ms-access
Subject: Re: FORMULARIOS
Date: Tue, 23 Oct 2007 04:22:58 -0700
Organization: http://groups.google.com
Lines: 43
Message-ID: <1193138578.064015.247280@k35g2000prh.googlegroups.com>
References: <1190470527.268500.175230@w3g2000hsg.googlegroups.com>
NNTP-Posting-Host: 193.43.176.102
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1193138578 27212 127.0.0.1 (23 Oct 2007 11:22:58 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 23 Oct 2007 11:22:58 +0000 (UTC)
In-Reply-To: <1190470527.268500.175230@w3g2000hsg.googlegroups.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.0 cache.comune.gorizia.it:3030 (squid/2.6.STABLE13-20070515), 1.0 cache.comune.gorizia.it:3128 (squid/2.6.STABLE13-20070515), 1.0 proxy-sial (NetCache NetApp/5.5R5D8)
Complaints-To: groups-abuse@google.com
Injection-Info: k35g2000prh.googlegroups.com; posting-host=193.43.176.102;
   posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0