My client has an access database as the front-end and linked tables from an MS SQL database. The called me because when they ad a new record for a specific product all the products purchases gets updated with the last record that was entered.
After investigating I noticed that it displays as the first record but in the database the records are different. I then stepped through the code and I noticed that what is selected in the query and what is displayed is different.
strsql = "select transaction_no, quantity, price, date, productid from product where transaction_no = " & varTransNo
This query gives you 3 different record ... im not gonna do any error checking or any formating in this example. They are using DAO
set rs = db.openrecordset(strsql)
Do Until rs.EOF
varRecord = rs.fields(Transaction_no) & " - " & rs.fields(quantity) & " - " & rs.fields(price) & " - " & rs.fields(date)
The result will be as follows:
1 - 9 - $2 - 2007/01/01
1 - 5 - $5 - 2007/01/05 (It is suppose to be: 2 - 5 - $5 - 2007/01/05)
1 - 2 - $1 - 2007/02/01 (It is suppose to be: 3 - 2 - $1 - 2007/02/01)
I have never seen in my seven years something like this.
If you have any idea what you think the problem can be please email me on kamnandi at gmail dot com
Thanks a mill
After investigating I noticed that it displays as the first record but in the database the records are different. I then stepped through the code and I noticed that what is selected in the query and what is displayed is different.
strsql = "select transaction_no, quantity, price, date, productid from product where transaction_no = " & varTransNo
This query gives you 3 different record ... im not gonna do any error checking or any formating in this example. They are using DAO
set rs = db.openrecordset(strsql)
Do Until rs.EOF
varRecord = rs.fields(Transaction_no) & " - " & rs.fields(quantity) & " - " & rs.fields(price) & " - " & rs.fields(date)
The result will be as follows:
1 - 9 - $2 - 2007/01/01
1 - 5 - $5 - 2007/01/05 (It is suppose to be: 2 - 5 - $5 - 2007/01/05)
1 - 2 - $1 - 2007/02/01 (It is suppose to be: 3 - 2 - $1 - 2007/02/01)
I have never seen in my seven years something like this.
If you have any idea what you think the problem can be please email me on kamnandi at gmail dot com
Thanks a mill