I created a database with two tables. The purpose of this database is to
monitor what supplies (SUPPLIES table) were given to who (CLIENT table),
when they were given, and how many. I hope I have my structure correct,
but if there;s any room for improvement, it would be more than welcome.
Basically, what I want to happen is:
- client approaches staff and asks for supply
- staff enters ID number and if
- client already has an entry in database, staff just adds the new
supplies the client needs which goes to the SUPPLIES table
- client is not in database, staff creates a new entry in the CLIENT
table and enters supplies given accordingly.
For the CLIENT table i have the following fields: ID, FirstName,
LastName. For the SUPPLIES table, I have: ID, Date Given, Item, Quantity.
I've set the ID as primary key in the CLIENT table, and made a
relationship between the corresponding fields in the CLIENT and SUPPLY
tables.
I created a form using the wizard and set the SUPPLY as a sub-form of
the main form which uses the fields of the CLIENT table (e.g. ID,
FirstName, LastName). Now when I enter data in the ID, say 1234, if
there is an existing entry under the Supplies table that is associated
with the primary key, in this case, ID in the CLIENT table, the items
show up on the form.
What I would like to happen is to have the FirstName and LastName show
up as well when an existing ID is entered in the form that is already
existing in the CLIENT table. It's kinda like a search form, that tells
you when there is an existing entry already. Do i need to create a
separate table that will duplicate the FirstName and LastName fields so
that they show up when an existing ID in entered? Or should there be a
separate form to do "searching" and another one to enter new data?
One of the many problems is that when the form is opened, it is placed
on the first entry so that the user enters an ID that is already
existing, it does show up the corresponding entries in the SUPPLIES
table, but the action is treated as trying to replace the primary key in
the CLIENT table, which is the ID. I encounter errors here. I wonder how
I can get around this.
I hope someone could help me out as I've never had the need to create a
database, hence, I have limited understanding of how to properly
structure tables and fields, when there is a need to create new tables
and establish new relationships - not to mention that the more complex
tasks like macros and some programming. Thanks in advance!
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@openoffice.org
For additional commands, e-mail: users-h...@openoffice.org