473,404 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

campo dependiente de otro en un formulario

Hola, necesito ayuda.

Tengo un formulario en access 2003 y necesito hacer que al elegir en
un combo la provincia me salga la lista de los municipios de esa
provincia, los cuales tengo almacenados en una tabla.

Consigo que lo haga si elijo la provincia, cierro el formulario y
despues lo vuelvo a abrir, pero necesito que lo haga automaticamente
sin tener que cerrar el formulario, y eso no lo consigo, he pensado en
ejecutar alguna macro cuando recibe el foco el campo municipio, pero
sigo sin conseguirlo.

Gracias.

Nov 20 '06 #1
1 8187
Hola. Si tienes dos combos, cbxCombo1 y cbxCombo2, simplemente tienes
que asociar el row source del segundo al primero utilizando el event
"AfterUpdate" del primero:

Private Sub cbxCombo1_AfterUpdate()
Dim strSQL As String
strSQL = "Select " & Me!cbxCombo1
strSQL = strSQL & " from Categories"
Me!cbxCombo2.RowSourceType = "Table/Query"
Me!cbxCombo2.RowSource = strSQL
End Sub

Buen Provecho,

Alexandre Bejerman
Montreal, Canada
Neolo wrote:
Hola, necesito ayuda.

Tengo un formulario en access 2003 y necesito hacer que al elegir en
un combo la provincia me salga la lista de los municipios de esa
provincia, los cuales tengo almacenados en una tabla.

Consigo que lo haga si elijo la provincia, cierro el formulario y
despues lo vuelvo a abrir, pero necesito que lo haga automaticamente
sin tener que cerrar el formulario, y eso no lo consigo, he pensado en
ejecutar alguna macro cuando recibe el foco el campo municipio, pero
sigo sin conseguirlo.

Gracias.
Nov 20 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: melogranina | last post by:
Salve! Ho la necessità di creare un documento xsl con una tabella che deve avere i campi della stessa lunghezza del valore ottenuto da una funzione javascript: <?xml version="1.0"?>...
1
by: Davide | last post by:
Perche' non riesco ad inserire immagini opiu' grandi di 1Mb in un campo LONGBLOB? Ha forse il limite di 1Mb il campo LONGBLOB? Se si, posso modificare tale limite? Per le immagini inferiori a...
5
by: Gema | last post by:
Hola a todos, Tengo un problema, no se me ocurre como solucionarlo. Utilizo SQL Server 2000. Tengo una tabla (tblRespu) en la que quiero insertar tres valores: el primero procede de una...
2
by: Jorge Gallardo | last post by:
Hola, tengo una duda. tengo una base de datos de facturacion, y en el formulario de facturas, al meter el importe en euros, tengo que teclear 135,50 es decir 6 pulsaciones. Lo que me gustaria es...
1
by: Underdub | last post by:
Hola al grupo. Estoy realizando una base de datos en access y me esta resultando compleja en campos con el dia a dia en el que se me ocurren cosas. Mi problema es que tengo tres campos que...
1
by: g.magliozzi | last post by:
Ciao a tutti, dopo aver copiato dei record tramite una query di accodamento su una tabello ho la necessità di modificare un campo (che risulta vuoto) su tutti i records spostati. Come posso...
0
by: | last post by:
Ho notato che se lascio un text box vuoto ottengo un errore in fase inserimento valori in una tabella (INSERT INTO) string IDAzienda = CodiceIns.Text; string Ragione = RagioneIns.Text; ...
4
by: GZG | last post by:
Por ejemplo Dim FRM As String = "fUno" 'y poder yo decir lo siguiente FRM.Show 'se asume que hay un formulario con el nombre fUno en mi proyecto 'mi necesidad es crear un objecto...
1
by: =?Utf-8?B?TWFyY2Vsbw==?= | last post by:
hola amigos.... tengo dos formularios en los cuales desde uno de ellos quiero poder modificar lo que lleva dentro un textbox el otro. agradesco su colaboracion. Marcelo
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.