Results 1 to 11 of 11
  1. #1
    archie is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    26

    Need help in subform and report

    good day, I'm having a little problem in subforms and report. Here's what i want to do; i want to create a list of equipments listed in a certain room and will generate a good report. but, when i create a subform in the buttom of my "title" and add a new list of equipments in a different room. it always warns me that it would create a duplicate. it's a good thing that it warns me about a duplication in my first input. but, how about if i add a new room? what if i want to input a same equipment in that room? how can i eliminate the warning sign?



    also in my report. Why is it that when i input a series of equipments in that room and view it in the report, it would create a multiple Description of that equipment?


    i hope i explian it clear and any help would be much appreciated.

    Also i attached a sample access here, i hope you can help me.

    thank you

    archie

  2. #2
    archie is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    26
    need help asap pls

    thank you

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,923
    If I were you I would look at the Indexes that have been created. Why have you turned on Cascade Updates and Deletes in the relationship?

  4. #4
    archie is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    26
    actually i just set my index file to prevent a duplication in my inputs.

    example:

    Building: ICU
    room number: 1

    Item Description Qty category
    1. chair 1 non medical
    2. bed 2 non medical
    3.oxygen tank 1 medical

    what im trying to do is preventing a same input in the room1 like chair again. when i create another room which is room 2 and input a new list of equips, it says that it would create a duplicate. why is it? is my idea of using a subform is right? is there another way that when i want to add a bunch of list equip it will not limit the input?

    using a subform is not my idea in first place, becuz what i did is create another text boxes which will input a list of equips. the bad thing is that it is limited. a friend told me that i use subforms, so that the inputs will be continues but, the problem is in the reports, it creates a duplicates of the titles as you can see in my sample like ID, item, qty and category. when i see this, i assume that those will be in the second pages.



    i dont know the use of the cascade that you are talking about, i just select them becuz i think it will also delete/updates what i done changes in their relations.

    Thank you and sorry for bothering too much

    archie

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,923
    You can check for duplicates in the BeforeUpdate event of each control on your form and issue a message of you choosing and Cancel the update when they are located. Using indexes gives you the error that Access wants to give with little choice as to content. It looks to me like you are trying to get by without knowing any programming. Could that be possible?

  6. #6
    archie is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    26
    i see, i think i get a little of what u mean . In short, i have to code it in the subform.

    so using a subform is a right idea, rather than text boxes?

    how about in the reports, how come it shows a series of item, qty and categories? more likely, those data were supposed to be in the next pages

    i only know just a little programming from reading in the forums, and im kind of new in access

    can you give me a link or sample code on preventing duplication?

    thank you

    archie

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,923
    We use a MainForm/SubForm arrangement to properly display a 1:m relationship with the 1 side being on the MainForm. You have Rooms and Objects with there being many Objects possible in One room. I would say that pary of your system is correct. Have you looked at the NorthWind sample that ships with Access? It has many examples of this arrangement.

  8. #8
    archie is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    26
    i havent seen his example but, I'll try to browse it here later, or you can give me a link if you dont mind.

    how about in my reports, what could possibly be wrong?
    also, about the code in duplications where can i get an example?


    sorry for asking too much questions , i think this forum is the best place for me to learn access

    thank you for your help

    archie

  9. #9
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,923
    The Northwind example is under the Help menu.

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,923

  11. #11
    archie is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    26
    i saw this example, but i cant quite understand it
    is there a much simpler sample?

    Since you saw my reports, how come my Item number, qty and category gets repeated?

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

Similar Threads

  1. Replies: 1
    Last Post: 02-02-2009, 05:52 AM
  2. Replies: 0
    Last Post: 10-24-2008, 11:20 AM
  3. report prints blank page at end of report
    By darrellx in forum Forms
    Replies: 0
    Last Post: 03-14-2006, 08:51 PM
  4. Replies: 1
    Last Post: 12-10-2005, 04:52 PM
  5. Subform in a Subform and relationships
    By St3ph3n in forum Database Design
    Replies: 3
    Last Post: 12-06-2005, 06:34 PM

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