Results 1 to 11 of 11
  1. #1
    Power_User is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    6

    Need Help To Search

    Hello My Friends ,



    Because I am new in access and will explain you my problem. I have four databases as follows:

    Table 1: Fields: ID - Company Name - Total Amount

    Tables 2, 3, 4: Fields: Company Name - Code - Date - Amount

    Table 5 ( Search Result ): Table1.ID - Table1.Company Name - Table1.Total Amount - Table2,3,4.Code - Table2,3,4.Date - Table2,3,4.Amount

    1- I need a query which search all Tables2,3,4 for field company name in first record of Table1 and if found records match to company name, add to Table5 and if not found any match, returned 0 as value to Table5 and then go to the next record in Table1 and do search all other 3 Tables again. I need to find a way to program automatically to do it and find any results from all three other Tables. Note: All Tables are inside an .accdb database.
    2- Is it possible when program find matchs , mark finded records in Table1 for delete . Because in the end of program , we should have to tables . Table5 with result of search and Table1 with records that doesn,t math in other Tables.



    Too much thanks for your help
    Jack
    Last edited by Power_User; 12-25-2016 at 12:17 AM.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Are you confusing database with table?

    cross posted at http://www.access-programmers.co.uk/...d.php?t=291162


    Jack,

    I recognize that this is your first post, but there is a way to cross post to get answers.
    Please see this info.

  3. #3
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 10 Access 2013
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,538
    In addition to Jack's question, why do you have three tables with the same type of data. Suggest you read this link about design.

    http://r937.com/relational.html

  4. #4
    Power_User is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    6
    Hi Orange .
    Thanks for your response and attention . You right . My purpose was tables in the .accdb database . And again you right . I post my problem in some other access forum because as i said , i am new to access and this is my first serious work in new office that just start working . this is important for me to do this in best way and get correct result to continue work . For that i ask from my friends in all around the world to help me . If you think i mistake ask my question in your forum , OK I leave here . But if you want to help me and other people that may have this problem , it was better dont notice here and on other forum . Just send me private message and help me with an example to solve my problem .

    Best Regards

    Jack

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    There is no mistake with your question. As I said previously, there is an accepted way to cross post.
    When you cross post, just tell people you have done so - and post the related link(s).

    Welcome to the forum.

  6. #6
    Power_User is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    6
    Hi Orange .
    Thanks again for your response . One of my best friend in other forum try to help me and solve my problem . If solve the problem , sure I notice here and insert the solved problem sample here . If is possible to you , may you follow that forum and say your idea or help me with an example ?
    Thanks
    Jack

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Yes, that's a good idea. Whether you cross post or not, it is good for others when you tell us what your solution is.
    Too many times users find an answer to their immediate problem and just leave.

    I encourage you to tell us your solution. In fact, if your solution has broader application you might consider putting a sample in the forum Code Repository or Tutorials or Sample Databases.

  8. #8
    Power_User is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    6
    Hello My Friends ,


    1-With help of one of my best friend in other forum . he create an example . With many thanks from his help , I put solution here :

    Database.zip


    After run qry_MakeTable5 , Result as follows :

    Click image for larger version. 

Name:	Result.jpg 
Views:	20 
Size:	86.9 KB 
ID:	26822


    If possible, I need to make some change on query or use any way after finish query remove repeated items and create something like follow :

    Click image for larger version. 

Name:	Required.jpg 
Views:	20 
Size:	86.0 KB 
ID:	26823


    2- Is it possible when program find matchs , mark finded records in Table1 for delete . Because in the end of program , we should have two tables . Table5 with result of search and Table1 with records that doesn,t mathc in other Tables.

    Thanks for your help

    Jack

  9. #9
    Power_User is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    6
    Hi Orange .
    I have a question . In other forum I close my Poset as solved because I received my question on that post and start new post for complete example received in that post by help of experts . I dont know in this forum can I continue in this post or create new post ? Please answer what I do ? Now is important complete the example for use other people that may need .
    Thanks
    Jack

  10. #10
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    I do not understand the issue you are facing. In your solution what do the records/rows with no company name represent?

    Since your tables have same format, you could bring them into a temp table and work with a normalized structure.

    You may also get some ideas from these video tutorials.

    Intro to Database
    The Relational Model
    Data Modelling and the ER Model

  11. #11
    Power_User is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    6
    Hi orange ,
    My mean is if possible the repeated company name only one time show in table . because whith the query method , for each match find by query , the company name repeated . I think maybe possible after finish query , use code to find repeated company name in the fields Company Name , Total amount and delete them . Maybe I should use Temp Table or report to get my ideal solution . I ask you as an access expert , tell me a best way you think with apply in sample database .
    Thanks
    Jack

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

Similar Threads

  1. Replies: 3
    Last Post: 09-12-2016, 11:49 AM
  2. Replies: 8
    Last Post: 09-02-2015, 03:00 PM
  3. Replies: 1
    Last Post: 03-26-2015, 11:08 AM
  4. Replies: 3
    Last Post: 01-04-2015, 06:09 PM
  5. Replies: 3
    Last Post: 09-02-2013, 04:33 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