Results 1 to 10 of 10
  1. #1
    hmsahir4u is offline Novice
    Windows XP Access 2003
    Join Date
    May 2012
    Posts
    6

    Number of records is diffirent in Table and Query


    Dear Fourm members.
    I am facing a very strange problem. I have table when I open it I found total number of records 1000 while I get result through query I found that 2 records or more than present in the Table mean in query number of record is 1002. I donot understand why these tow records are not seen in the actual table. and these are not deleted by delete record qurey. While I can see it in select command.
    Waiting for positive reply as earl as possible

  2. #2
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Does your query contain more than one table? If it does, please post the SQL of the query.

    John

  3. #3
    hmsahir4u is offline Novice
    Windows XP Access 2003
    Join Date
    May 2012
    Posts
    6
    Dear Sir
    I could send you the data base file if you will ask. how ever SQL of Query is as under

    SELECT Transaction_Detail.Debit, Transaction_Detail.Credit, Transaction_Detail.Price, Transaction_Detail.Qty, Transaction_Detail.Discription, accountmaster.accuname, achead.accatname, Transaction_Detail.VANumber, Transaction_Detail.Vnumber, Transaction_Detail.AccountID
    FROM (Transaction_Detail INNER JOIN (accountmaster INNER JOIN achead ON accountmaster.accatname = achead.accatname) ON Transaction_Detail.AccountID = accountmaster.acid) INNER JOIN Transaction_Main ON Transaction_Detail.Vnumber = Transaction_Main.TransId
    ORDER BY Transaction_Detail.VANumber;

    It contain multiple tables

  4. #4
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    Which is the table that looks like it has too many records?

    The issue is with your data, not MS Access. Your problem is happening because one of your joins, which you expect to be referring to only one record, actually refers to more than one, and your query wil contain one line for each of them.

    It's only a guess, but check accatname in table achead, and acid in table accountmaster. One of those may be duplicated by mistake (I would guess it might be accatname)

    HTH

    John

  5. #5
    hmsahir4u is offline Novice
    Windows XP Access 2003
    Join Date
    May 2012
    Posts
    6
    Dear John
    I would like to tell you the background for this error. The Software which I have designe for a small pesticide shop was working accuratly from last 1 year. This problem was due the electricity failure during the saving process of the entry. So when the operator start the computer he saw these transaction in the transaction detail table. He has tried to delet these records but records are not deleted from the table so this problem has been seen. I wonder that why this database is not deleting that entries. while it was working good in last year.
    Hope the you have got my point.
    Regards
    Hamid!

  6. #6
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    A power failure during a save - you may have a corrupted database. Have you tried a compact and repair? That's always the first step. In this case (and in any case really), make a backup copy before doing the compact and repair.

    Just a question - when your user tries to delete the records, but can't - is there any error message shown?

    John

  7. #7
    hmsahir4u is offline Novice
    Windows XP Access 2003
    Join Date
    May 2012
    Posts
    6
    Hi
    I have not tried compact and repair yet because everything except these two records are in good condition and the program is running well. There is no error when we use delete command and as I have told you that the record is not visible in Transaction Detail table but when I use query in Access it become visible in query. and the same record is visible in my VB.net base software.
    I will try to repair it.
    Thanks
    Hamid

  8. #8
    hmsahir4u is offline Novice
    Windows XP Access 2003
    Join Date
    May 2012
    Posts
    6
    Dear John,
    Thank you for your great contribution and cooperation to resolve the problem. The problem was solved using "Compact and Repairing" Utility
    Regards

    Hamid

  9. #9
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    Glad to hear your problem has been resolved. If you are in a part of the world where power failures are common, you should consider making it a part of your daily procedure to make a backup copy of the database.

    Cheers!

    John

  10. #10
    hmsahir4u is offline Novice
    Windows XP Access 2003
    Join Date
    May 2012
    Posts
    6
    Dear John, It was wonderful information for me. Although I am living in Pakistan which has worst power failure problem but I always advise to my customers to use UPS with the system at which software is running. I have made an Inventory and finance software for my local language on self study bases. Thanks once again for your suggestions. Regards! Hamid

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

Similar Threads

  1. Replies: 3
    Last Post: 02-01-2012, 08:19 AM
  2. Replies: 6
    Last Post: 07-25-2011, 01:54 PM
  3. Sequentially number records in a table field
    By kenton.l.sparks@gmail.com in forum Programming
    Replies: 4
    Last Post: 04-08-2011, 08:24 PM
  4. The number of records in a query
    By Persist in forum Programming
    Replies: 3
    Last Post: 07-13-2010, 06:23 AM
  5. Replies: 1
    Last Post: 01-31-2009, 10:43 AM

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