option group- is there an option?

sphere

Registered User.
Local time
Today, 09:09
Joined
May 21, 2001
Messages
19
Hi everyone =)
I would like to know if i can link a field to an option group.
To be more specific,
the buttons on the option group will represent locations (ie. NY, UK, HK)
the field represents the departments.
So, I would like to be able to pick (hopefully with a list box) the name of the department, then the location.
In the table i should be able to read under the department field- the department and the location. so i guess this would be concatenating.
I really don't know how to get this done and i would very much appreciate some advice.
thanx
 
If I understand what you are trying to accomplish, here is how I would do it.

To follow table normalization I would structure your "main table" this way

Add a department field (numeric, long) and a location field (also numeric, long).

Create two tables: tblDepartments, tblLocations

Each of these tables will have only two fields. ID (autonum) and Description.

Add the departments and locations to the respective tables.

Use tblDepartment as the datasource for your combobox, (use the wizard to make things easier) and set the controlsource for the combo as the department field from your main table.

Set up your option group, using labels that correspond to the descriptions in your tblLocations. Set the controlsource for the frame as the locations field from your main table.

THEN
Any time you want to display the actual descriptions (like for reporting purposes) you can use a query that links the two description tables to the "main table".

I apologize if this is confusing, I haven't had my second cup of cappucino this morning. Let me know if you have any specific questions

Charity
 
thanx charityg...
i definitely need another cup of coffee too =)
so, i understand the whole combo box thing, the problem is that ii'm sort of re-programming a database, so there's already alot of records. i just want to make the data entry easier.
they used to just type in the department names and locations, i figured it would definitely be more consistent to make a basic list of departments (this way if there's 2 departments they can just highlight the 2).
since the locations are not something that always show up, i thought it would be nice to use that option group thing.
the only problem is that if the original department field is now going to be split up (dept. and location) i need these to all go into one field. i've heard of concatenating but i've never used the option so i don't really know how it works. can i somehow get the data entry for location and department all into the department field?...
sorry for making this long.
thanx!
 
Use a select case in the after update event of the frame.

something like
dim strLocation as string
select case grpLocation
case 1
strLocation="NY"
case 2
strLocation="UK"
case 3
strlocation="HK"
end select
me!department=me!department & "-" & strLocation

[This message has been edited by charityg (edited 07-12-2001).]
 

Users who are viewing this thread

Back
Top Bottom