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

Combo box question

I'm creating a data entry form for my primary table (birds observed)
and want to use a combo box that refers to a lookup table (locations).
I've set the combo box to except new locations (ones not in the
table). This populates the location field in the primary table okay,
but it does not add the new location to the lookup table. Is there a
way to make this happen automatically? Thanks in advance for any help.
Nov 13 '05 #1
2 1245
On Fri, 04 Feb 2005 21:49:49 -0500, RustyMoran <hm****@erols.com>
wrote:

Seems like something is incorrect in your database design. You are
saying the new location is added to tblBirdsObserved, but not to
tblLocations?
Proper relational db design would mandate this structure:
tblBirdsObserved with fields including LocationID
tblLocations with fields LocationID, LocationName, etc.
There would be an enforced referential integrity link between the two
tables, ensuring the first table can only have LocationID values that
occur in the Locations table. This would make your current behavior
impossible.

Then you design a 2-column combobox that pulls LocationID,
LocationName from the Locations table; LocationID is a 0-width column,
and is the bound column. The way I think about it is that a combobox
is an ideal tool to give the db what it wants (ID values) while giving
the humans what they want (Name values). The human thinks she is
selecting a name, while under the hood we are storing an ID value.

The combobox would be limit to list, and if you enter a location that
does not yet exist, the NotInList event fires. There you can write
code to add the new location to the table (perhaps using an Append
query), and have Access reload the combobox and try to find the value
again.

Happy programming.

-Tom.
I'm creating a data entry form for my primary table (birds observed)
and want to use a combo box that refers to a lookup table (locations).
I've set the combo box to except new locations (ones not in the
table). This populates the location field in the primary table okay,
but it does not add the new location to the lookup table. Is there a
way to make this happen automatically? Thanks in advance for any help.


Nov 13 '05 #2
Tom, I haven't had a chance to try your suggestions, but I will.
Thanks a lot. Rusty

On Fri, 04 Feb 2005 21:11:47 -0700, Tom van Stiphout
<no*************@cox.net> wrote:
On Fri, 04 Feb 2005 21:49:49 -0500, RustyMoran <hm****@erols.com>
wrote:

Seems like something is incorrect in your database design. You are
saying the new location is added to tblBirdsObserved, but not to
tblLocations?
Proper relational db design would mandate this structure:
tblBirdsObserved with fields including LocationID
tblLocations with fields LocationID, LocationName, etc.
There would be an enforced referential integrity link between the two
tables, ensuring the first table can only have LocationID values that
occur in the Locations table. This would make your current behavior
impossible.

Then you design a 2-column combobox that pulls LocationID,
LocationName from the Locations table; LocationID is a 0-width column,
and is the bound column. The way I think about it is that a combobox
is an ideal tool to give the db what it wants (ID values) while giving
the humans what they want (Name values). The human thinks she is
selecting a name, while under the hood we are storing an ID value.

The combobox would be limit to list, and if you enter a location that
does not yet exist, the NotInList event fires. There you can write
code to add the new location to the table (perhaps using an Append
query), and have Access reload the combobox and try to find the value
again.

Happy programming.

-Tom.
I'm creating a data entry form for my primary table (birds observed)
and want to use a combo box that refers to a lookup table (locations).
I've set the combo box to except new locations (ones not in the
table). This populates the location field in the primary table okay,
but it does not add the new location to the lookup table. Is there a
way to make this happen automatically? Thanks in advance for any help.


Nov 13 '05 #3

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

Similar topics

3
by: NB | last post by:
Let's say in the product table I have around 50,000 products (well, infact it has now about 2000 only, but it's growing very fast, hence the question here) In the order form, users will select...
3
by: Marcus Canales | last post by:
Hello all, Here is my situation. I have a combo box on a form. The combo box is linked to a qry (qryCustomers) and the form is linked to tblOrders. The way I currently use the combo box is to...
8
by: Lyn | last post by:
Hi, Can anyone tell me how the initial value displayed in Combo Box is determined when a form is opened? I am loading the dropdown from one field ("CategoryName") of a table, with "ORDER BY ". ...
1
by: Shawn Yates | last post by:
It has been a while since I have done anything on MS Access and I seem to be a bit rusty. I hope someone could help me solve my issue. I have a form that has multiple combo boxes on it. Each box...
2
by: Sid | last post by:
I need some help in setting up Access combo box. I am using three comboboxes in my form. Comb Box 1, Combo Box 2, Combo Box 3. The row source for each of the combo box is a seperate table. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.