Problem in form creation~

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • faiyeah

    #1

    Problem in form creation~

    Here is my database design:

    Entity
    ------
    Publisher([PubCode], PubName)
    Author([AuID], AuName)
    Sale([BkCode], Price, UnitOnHand)
    Book([BkCode], Title, BkType, PubCode)


    Relation
    --------
    Edit([BkCode], [AuID])


    When I create a input form by wizard, I use


    Publisher([PubName)
    Author([AuID], AuName)
    Sale(Price, UnitOnHand)
    Book([Title, BkType, PubCode, BkCode)


    as my selected filed...


    When I open the created form, a automatic Record slider is at the
    bottom. When I want to create a new record... error occurs... saying
    that...


    You cannot add or change a record because a related recrod is required
    in table "Book"


    What should I deal with this problem?


    Here is the relationship:
    Author 1 - many Edit (Cascade update)
    Book 1 - many Edit (Cascade update, delete)
    Book 1 - 1 Sale (Cascade update, delete)
    Publisher 1 - many Book (Cascade update)

  • Bob Quintal

    #2
    Re: Problem in form creation~

    hello,

    "faiyeah" <faifai1201@gma il.com> wrote in
    news:1143865638 .913916.300440@ u72g2000cwu.goo glegroups.com:
    [color=blue]
    > Here is my database design:
    >
    > Entity
    > ------
    > Publisher([PubCode], PubName)
    > Author([AuID], AuName)
    > Sale([BkCode], Price, UnitOnHand)
    > Book([BkCode], Title, BkType, PubCode)
    >
    >
    > Relation
    > --------
    > Edit([BkCode], [AuID])
    >[/color]
    Very good structure. We'll now look at the relations (moved from
    below.)
    [color=blue]
    > Here is the relationship:
    > Author 1 - many Edit (Cascade update)
    > Book 1 - many Edit (Cascade update, delete)
    > Book 1 - 1 Sale (Cascade update, delete)[/color]

    I don't think one to one here is good. You may make many sales
    of copies of one book. one to many is preferred.
    [color=blue]
    > Publisher 1 - many Book (Cascade update)[/color]
    [color=blue]
    >
    > When I create a input form by wizard, I use
    >
    >
    > Publisher([PubName)
    > Author([AuID], AuName)
    > Sale(Price, UnitOnHand)
    > Book([Title, BkType, PubCode, BkCode)
    >
    >
    > as my selected filed...
    >
    >
    > When I open the created form, a automatic Record slider is at
    > the bottom. When I want to create a new record... error
    > occurs... saying that...
    >
    >
    > You cannot add or change a record because a related recrod is
    > required in table "Book"
    >
    >
    > What should I deal with this problem?
    >[/color]
    When creating a new record, you violate the referential
    integrity in the query that the Wizard has created in the form.

    Easy fix. create the form using only fields from book. Use
    comboboxes to populate bkType, PubCode. Make a separate form for
    entering the info to the Edit table. Note that edit is a
    reserved word in access and you may encounter situations where
    ACCESS gets confused.

    Make a separate form for entering sales info, again using
    combobox for the BkCode
    [color=blue]
    >
    > Here is the relationship:
    > Author 1 - many Edit (Cascade update)
    > Book 1 - many Edit (Cascade update, delete)
    > Book 1 - 1 Sale (Cascade update, delete)
    > Publisher 1 - many Book (Cascade update)
    >
    >[/color]



    --
    Bob Quintal

    PA is y I've altered my email address.

    Comment

    Working...