Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quick Questions - Multiple Entries per Field!

Status
Not open for further replies.

slaman

Programmer
Jun 8, 2001
47
CA
Hello,

I am a learner of database programming, but I cannot seem to figure out a way to create a database using Corel Paradox that does what I want. For example, I want to have a field entitled "Members" with the number of members being unspecified. Each Entry in the Table will have its own list of "Members". Is there a way to do this instead of having a field for "Member1", "Member2", "Member3" etc...

On the form, I want to say: "List all members"

Then have a spreadsheet-style place where the user can input an unlimited number of Members before going on to the next field.

Secondly, I know this seems stupid, but when Restructing a Table, how can I DELETE a field? The closest thing I've done is rename it...

Have patience with me - I'm learning.
 
The only way I can think of that will accomplish what I am trying to do is have a separate database for each entry in the main database. Can you have a database of databases? For each main entry in my database, it would require a database containing all the members of that company... Am I missing something here? I'm SURE I'm not the first person who has wanted to do something like this...

 
Your question is very common, especially when you have worked mainly with spreadsheet.

There are a few ways to accomplish what you want.

But first, let me make a few assumptions.
Assuming you want to keep track of membership of your group. Ideally, you would like to keep information on each member of your group. Common informations are:
Contact information
Membership information

Contact information:
Name, Address, Phone #

Membership information:
Date joined, Type of membership, Amount Paid

Your information would look something like this
First and Last Name: John Smith
Address: 123 Main Street
City, State, Zip AnyCity, FL 01234
Phone 123-123-1234
Date Joined 06/01/2001
Membership Type Regular
Amount Paid 100

So, how to keep track of every one in a table.
Tabe Structure
Field Name Data Type
MemberID S
Address1 A25
Address2 A25
City A15
State A2
Zip A10
Phone A12
DateJoined D
MemberShipType A10
AmountPaid N

MemberID, you can use auto-increment data type.

Now, to store membership data, you create one record for each member.

Your table would look something like this:
First Last Address….
1 John Smith 123 Main Street...
2 Mary Doe 1 First Street…..
3 Bill Clinton …..
4 George Bush ….

I hope this answers your question.

To delete a field in Restructure:
Place the cursor on the field you want to delete
Hold down control (CTRL) key and press the Delete key
 
Alternatively, if you are tracking members of multiple groups. Your data relationship would look something like this:

Group ->> Members

For each group, you can have 0 or more members. A one-to-many relationship.

You will need 2 tables. A parent and child tables.

Parent Table:
Group.db
GroupID
GroupName

Child Table:
Members.db
GroupId
MemberId
First Name
Last Name
Address…

You connect the 2 tables by using the Group ID
For each group id in the group table, you can have 0 or more members in the members table. Each member in the members table is identified by its GroupID and MemberID.

That is, given the group and member ids, I can uniquely identify each member.

Of course, there are a lot more than what I have just described. You should look at the Pdox example application to see how it works.

Good Luck
 
Unfortunately, you misinterpreted what I am trying to do. I understand how to create fields and link two tables using ID's. What I am trying to do is this:

I have a database of "Organization". Each of these "organizations" have a series of fields - such as Address, Phone Number, Director, etc... One of these fields is "Members" where the number of members can vary anywhere from 1 to 100. How would I store this data without creating specific fields for "Member 1" then another field for "Member 2". And for each "field" of Member, I want to be able to add information such as phone number of the member. Each organization will have its own list of members. And no members are a part of two organizations - so having an entire members.db wont be sufficient. Im thinking I might need a members-organization.db for EACH organization in the main database. This is highly inefficient and I don't know how to automatically create a new database to store this information when inputting a new organization. There must be an easier way...

 
I cannot believe I didn't realize this earlier. I don't NEED to have the "members" as a field in the main database - just a linking ID (in this case the corporation ID) and when I display the information, I can display it by doing a query on members.db for Corporation Name. It makes sense to me now - I'm not sure if I make sense to you :)
 
I believe that what my 2nd example does.

Organizations - > > Members

Parent:
CorpID
CorpName
Address


Child
CorpID
MemberId
First Name
Last Name
….

For each organization, you can have 0 or more members.
The number of members is the number of records with the same Crop Ids.

By setting up the data model correctly, the form will display only the members in each CropID.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top