Results 1 to 8 of 8
  1. #1
    rave1991 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    4

    Problem of adding details to a record in a table

    I have created a database using access 2007. There is a one table called order and primary key is orderID and tpe is Auto number. Order(OrderID,Date, Time, CustomerID). There is another table for Pizza(PizzaId,PizzaName,PizzaPrice) PizzaID is a text type we include that. one customer can place a order and that order can have many pizzas.One to Many relationship. So I created a table pizzaOrder(OrderId,PizzaId,Amount).I have created a form.But customer can only place one pizza to his current order.i add a button.but when it clicked new order comes.customer can not add extra pizzas to his current order.I can`t implement this using forms. So please give me solution I want to add many pizzaID s to one Order.when customer can have ability to add pizzas using button like things. i have used toggle buttons and use a vba code to select pizzas. But customer can’t add many pizzas to his order. cutomer can only add one pizza to his order. So guide me to the correct way. I need a way that cutomer can add many pizza ids to his current order.



    When a customer want to add pizza for the second time new record must be added to the table PizzaOrder but his current order must be automatically add to the OrderID. I want to know how to implement this this by using button like thng.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You would normally deal with this 1:M relationship with a Form/SubForm arrangement. Is that what you are doing?

  3. #3
    rave1991 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    4
    yeah for example i customer add pizza to his current order 4.then he click add new pizza and add new pizza to his current order and pizzaOrder table must be updated with 2 records but same Order Id.we can manually add details but i want to know how to do this by using button.records must be cleard new record must be added to the PIzzaOrder table but with current order no.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    The LinkChild/MasterFields properties of the SubFormControl will take care of this issue if set to the OrderID field.

  5. #5
    rave1991 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    4
    can you please explain it further.

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Do you have anything in those two properties of the SubFormControl?

  7. #7
    rave1991 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    4
    i don`t understand i will give you a example.in order table orderId is the primary key and it is an autonumber..so there is no duplicates in thier. next there is table called pizza pizzaId is the primary key.there are three pizzas in there PizzaId s are E1232,C1942,F4567. but for Order no 4 customer wants to add these three pizzas to his to his OrderID 4. so i created a table intermediate table PIZZAORDER two attributes in there are OrderId and PizzaId. so
    OrderId pizzaid
    4 E1232
    4 C1942
    4 F4567

    so like this how do i add this using a form.also i mention i have included customer ID also.i have created a form that customer can choose his given customer id from the combo box then he can click the relevant button and add one pizza to his current orderID 4.then i included add new record button to form.so when customer click that button new order Id 5 will create.he can`t add many pizzas to his current order 4.so i want to know how to implement this

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    If the SubForm has the PIZZAORDER as its RecordSource and the OrderTable is the RecordSource of the MainForm and the LinkChild/MasterFields properties of the SubFormControl are set to OrderID, then everything you want to happen will happen and you do not need the extra buttons if the SubForm is in Datasheet View.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Adding a record not found in another table.
    By Buakaw in forum Queries
    Replies: 1
    Last Post: 03-03-2011, 05:38 AM
  2. Replies: 3
    Last Post: 02-01-2011, 07:15 AM
  3. Replies: 3
    Last Post: 10-28-2010, 07:02 AM
  4. Adding table to Query removes every 4th record
    By CoachBarker in forum Queries
    Replies: 1
    Last Post: 10-13-2010, 07:23 AM
  5. Re: Adding a new record to a joined table
    By Mcdodre in forum Access
    Replies: 4
    Last Post: 06-30-2010, 12:07 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums