473,386 Members | 1,924 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,386 software developers and data experts.

combobox filtering

Hi this is my first post. I have searched and searched the net to find my particular answer and have failed.
I am using ms access 2003.
I have 2 dbs linked. One db has site addresses in and the other has info based on each site address. I have a list of site ids in a drop down box which relate to the other db of full addresses. When I select a site ID from the drop down box I want the address field to automatically fill in the address based on the chosen ID from the previous field. Here are the details;

Call Off List is the db1
Sitename is a field which I input
Siteaddress is the field i want to be automatic

Sites is db2
Sitename is linked to the one above
SiteAddress is the field where the data is to be got from for above.

Hopefully this all makes sense??

Thanks in advance.
Feb 9 '07 #1
4 1855
ADezii
8,834 Expert 8TB
Hi this is my first post. I have searched and searched the net to find my particular answer and have failed.
I am using ms access 2003.
I have 2 dbs linked. One db has site addresses in and the other has info based on each site address. I have a list of site ids in a drop down box which relate to the other db of full addresses. When I select a site ID from the drop down box I want the address field to automatically fill in the address based on the chosen ID from the previous field. Here are the details;

Call Off List is the db1
Sitename is a field which I input
Siteaddress is the field i want to be automatic

Sites is db2
Sitename is linked to the one above
SiteAddress is the field where the data is to be got from for above.

Hopefully this all makes sense??

Thanks in advance.
Assumptions:
__1 Your Combo Box name is cboSiteID and its Bound Column is [Site ID]
__2 The Text Box to contain the Site Address is [txtSiteAddress]

Expand|Select|Wrap|Line Numbers
  1. Private Sub cboSiteID_AfterUpdate()
  2.     'If [Site ID] is a Numeric Field
  3.     Me![txtSiteAddress] = DLookup("[SiteAddress]", "db2", "[Site ID]=" & Me![cboSiteID])
  4.  
  5.     'If [Site ID] is a Text Field
  6.     Me![txtSiteAddress] = DLookup("[SiteAddress]", "db2", "[Site ID]='" & Me![cboSiteID] & "'")
  7. End Sub
Feb 9 '07 #2
NeoPa
32,556 Expert Mod 16PB
I'm guessing (as is ADezii by the looks of it) that db1 & db2 are actually different tables rather than different databases. Are we right?
...And does ADezii's solution answer your question?
Feb 11 '07 #3
Adezii, Thanks for your reply and fix. It worked a treat.
Sorry it took so long to get back I've been off for my Birthday!!!!!!

NeoPa yes Db1 and Db2 are tables within the same Database. Sorry i was misleading.

Once again thanks for your help. It's much appreciated!!
Craig

PS Sorry for the unhelpful Thread Description.
Feb 13 '07 #4
NeoPa
32,556 Expert Mod 16PB
Glad you're fixed there Craig (I can't call you CraigyBabes).
The title is fine actually - It says what it is - No problem.
Feb 13 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Steve B. | last post by:
My Program: a local C# ADO.Net application using VS 2003 Right now I have about 5 ComboBox's which provides drop down selection entries from the same MS-Access table via a DataConnection,...
3
by: Tim Ford | last post by:
People, I trying to write a lookup combobox that gets it's data via a sql table. I can populate the combobox with the information and have handled all the filtering, how ever i can't seem to...
2
by: Becker | last post by:
I have a need for a simple combobox on a form in one of my programs that represents city, state. I want to have it autocomplete as the user types. I have a table with these values (about 50k of...
5
by: Gil | last post by:
Is there a way to tell if a combbox is in dropdown mode. I tried and if statement combobox.dropdown = true but i get an error. dropwndown function doesnt store if its true or false what i am...
11
by: DSR | last post by:
Help Please... I would like to populate a combo box on a form with a query that compares data from two tables. Any record that is unique in table1 should continue to populate my combobox. The...
0
by: ER | last post by:
Hi Guys Started having a play with WPF and need some direction with a grid. I am trying to build a list of products in a grid view with combox boxes as column headers that allow filtering and...
4
by: glamster7 | last post by:
Hi I have a form viewbookings on which I have a combobox - filtgroupname & a subform bookingsubform. What I'd like to have is - the user chooses a name from the combobox & it filters the subform...
1
by: Bob Johnson | last post by:
..NET 3.5, Windows Forms app: My objective is to display parent/child data in two ComboBox controls, such that when a parent item is selected in one combo box, associated child items appear in the...
5
by: RHooper | last post by:
Hi, I'm new to Access, so I apologize if this question is trivial. I am trying to set-up a quick filter for users to define on a form bound to a table. I have a combo box called...
5
by: shiwawa | last post by:
I have a problem filtering records in my subform using a ComboBox in the Main Form. I have tried options proferred in other forums and have still not git the desired result. I know I must be missing...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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...

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.