473,401 Members | 2,125 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,401 software developers and data experts.

Combo box problem.

There are 2 tables, a table called parent and a table called child.

The parent table has 2 fields, an ID (AUTO Number: PK) and Name
(Parent Name)

The Child Table has 3 fields, an ID (AUTO Number: PK), ParentID(FK to
ID in parent Table) and Name(Childs Name)

The tables are related by the ID and ParentID

I want to create a form for entering child names but on that form I
want to select the Parent Name and then enter the childs name.

Can I have a combo box that has a list of parent's names but when you
enter the information it only enters the ID of the Parent into the
child table.

This is done easily with a list box in HTML where the bound column is
the value that is passed where as the text value is displayed.

Can this be done in Access 2003?

Thanks.
Ray
Nov 12 '05 #1
2 1199
Yes
Let the wizard build the combo for you. Should be easy
HTH
David B

Ray Bell <ra*********@hotmail.com> wrote in message
news:f6**************************@posting.google.c om...
There are 2 tables, a table called parent and a table called child.

The parent table has 2 fields, an ID (AUTO Number: PK) and Name
(Parent Name)

The Child Table has 3 fields, an ID (AUTO Number: PK), ParentID(FK to
ID in parent Table) and Name(Childs Name)

The tables are related by the ID and ParentID

I want to create a form for entering child names but on that form I
want to select the Parent Name and then enter the childs name.

Can I have a combo box that has a list of parent's names but when you
enter the information it only enters the ID of the Parent into the
child table.

This is done easily with a list box in HTML where the bound column is
the value that is passed where as the text value is displayed.

Can this be done in Access 2003?

Thanks.
Ray


Nov 12 '05 #2
Hi Ray,

I'd suggest a mainform / subform approach

Main form: frmParent based on tblParent
Sub form: sbfChildren based on tblChildren
LinkMaster : ID (or ParentID, if you follow my advice below.)
LinkChild : ParentID

Use a combo box ("cboParent") on the main form to find/display a
"ParentName" record with all of the associated information.
(Use the wizard ... "find a record on my form" option... assuming wizard is
still the same as Access97.)

The subform would allow you to enter/view the related children. The ParentID
is automatically entered into new subform records for you via the LinkMaster
/ LinkChild subform link.

Simple, easy, done. :)
--------------------------------------------

And now for some "been there... done that" advice.) <grin>
-----------------------------------------------------
1.) I'd like to caution you on your choice of field names... "Parent",
"Child", and especially "Name" are all words that should be considered
"reserved" Access program names and / or properties. Also, NEVER use spaces
in field names... and only use ALLCAPS / underscores as a last resort...
thats " *so* Dbase III " !
(All of this will make more sense to you if / when you start writing some
VBA code .... )

2.) I'd suggest disambiguating your "ID" fields in both of your tables.
Every time that you try to create a query, Access will assume that "ID" is
the join field, and you will have to change it manually.

Personally, I'd do it like this:

tblParent
---------
ParentID - AutoNumber - PK

tblChildren
-----------
ChildID - AutoNumber - PK
ParentID - Long Integer - FK
--
HTH,
Don
=============================
Use My*****@Telus.Net for e-mail
Disclaimer:
Professional PartsPerson
Amateur Database Programmer {:o)

I'm an Access97 user, so all posted code
samples are also Access97- based
unless otherwise noted.

Do Until SinksIn = True
File/Save, <slam fingers in desk drawer>
Loop

================================
"Ray Bell" <ra*********@hotmail.com> wrote in message
news:f6**************************@posting.google.c om...
There are 2 tables, a table called parent and a table called child.

The parent table has 2 fields, an ID (AUTO Number: PK) and Name
(Parent Name)

The Child Table has 3 fields, an ID (AUTO Number: PK), ParentID(FK to
ID in parent Table) and Name(Childs Name)

The tables are related by the ID and ParentID

I want to create a form for entering child names but on that form I
want to select the Parent Name and then enter the childs name.

Can I have a combo box that has a list of parent's names but when you
enter the information it only enters the ID of the Parent into the
child table.

This is done easily with a list box in HTML where the bound column is
the value that is passed where as the text value is displayed.

Can this be done in Access 2003?

Thanks.
Ray

Nov 12 '05 #3

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

Similar topics

4
by: Heather | last post by:
Hi I am desparately looking for advice in relation to storing the results after selecting items from two combo boxes on a Referral form. The first combo box 'ctl Type' displays a full list of...
1
by: Jeff Smith | last post by:
Hi This is a repost due to no responses Here's a problem I've encountered with Access 2003 which has got me to redesign how I get the row source in a second combo box using the first combo...
9
by: Edwinah63 | last post by:
Hi everyone, Please let there be someone out there who can help. I have two BOUND combo boxes on a continuous form, the second being dependent on the first. I have no problem getting the...
7
by: Ausclad | last post by:
Ok, ill try again..... It seems fairly simple. I have two combo boxes in a datagrid. The datagrid is bound to a a table in a dataset. The two combo boxes are bound to a single data table...
1
by: lawton | last post by:
Source: this is an access 2003 question My knowledge level: reading books, internet, and trial & error; no formal training I'm trying to get a running sum of what's filtered in a subform which is...
4
by: Dave | last post by:
I wasn't sure how to search for previous posts about this, it felt real specific. Ok so here's the database & problem: I have 4 combo boxes: cboServer, cboPolicy, cboDB, and cboApplication. ...
2
by: biganthony via AccessMonster.com | last post by:
Hi, I decided to install Office 2003 Service Pack 3 on my home computer to test (in full knowledge that there may be some issues with it). After installation, I have noticed that with a small...
3
rhitam30111985
by: rhitam30111985 | last post by:
Hi all.. i am trying to create a combo with the pop down list being modfied in real time as i type each character : import gtk window=gtk.Window(gtk.WINDOW_TOPLEVEL)...
6
by: =?Utf-8?B?amVmZmVyeQ==?= | last post by:
i need help with a combo box and this same code works on my first tab with a combo box. The error or problem i have is this code causes an index out of range error when i run it on my second combo...
3
by: evenlater | last post by:
Using Access 2007, I've found that combo box back colors change to transparent from normal inconsistently for no reason I can discern. Never had that problem in previous versions of Access. I do...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.