πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Ayuda con Campos de Tablas

#115
From: namor
Date: Mon, 22 Oct 2007 16:02
32 lines
2472 bytes
On 20 Ott, 00:10, BlackDraGoN <manuymar140...@hotmail.com> wrote:
> Como puedo acceder a los valores de una segunda tabla de un
> formulario, he
> introducido el siguiente codigo pero no me funciona, no se como hacer
> referencia al valor del campo de la segunda tabla.
>
> Private Sub Form_Current()
> If Me.NewRecord = True Then
>     [CodGasolinera] = [camposegundatabla] --> Como referencio al campo
> de
> otra tabla secundaria
>     [NomGasolinera] = [camposegundatabla] --> Como referencio al campo
> de
> otra tabla secundaria
> End If
> Me.Refresh
> End Sub
>
> P.D. Sabeis de algun enlace en espaΓ±ol con informacion sobre el manejo
> de
> registros de tablas en Visual Basic Acces.
>
> Muchas Gracias
> BDGN

Usa el Dlookup().
Si hay solo un registro en la segunda tabla:
  dlookup("camposegundatabla", "nombresegundatabla")
o si hay que buscar un cierto registro entre muchos:
  dlookup("camposegundatabla", "nombresegundatabla", "ID=" & Me.ID)
Hola.
-Marco-
Technical Details
Message-ID: <1193068942.719235.306620@q5g2000prf.googlegroups.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!q5g2000prf.googlegroups.com!not-for-mail
References: <1192831819.694937.243820@v23g2000prn.googlegroups.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 111a5a,6ec21813f6d92368
X-Google-Attributes: gid111a5a,public,usenet
X-Google-Language: SPANISH,ASCII
Path: arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!q5g2000prf.googlegroups.com!not-for-mail
From:  namor <marco.pizzamiglio@gmail.com>
Newsgroups: es.comp.bd.ms-access
Subject: Re: Ayuda con Campos de Tablas
Date: Mon, 22 Oct 2007 09:02:22 -0700
Organization: http://groups.google.com
Lines: 33
Message-ID: <1193068942.719235.306620@q5g2000prf.googlegroups.com>
References: <1192831819.694937.243820@v23g2000prn.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 1193068943 7813 127.0.0.1 (22 Oct 2007 16:02:23 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 22 Oct 2007 16:02:23 +0000 (UTC)
In-Reply-To: <1192831819.694937.243820@v23g2000prn.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: q5g2000prf.googlegroups.com; posting-host=193.43.176.102;
   posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0