If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Recordset MoveNext Problem. Please Help.
Hi All,
I having a problem with using the recordset .MoveNext in access. I have a form and using Combo Box to select and update data to certain table. But i having a problem with using .MoveNext function. Eventhough i able to detect the location where the data should be updated. When i use the ..MoveNext Function to access it, it always updated the wrong row of data. Can anyone advice how to solve this problem? Thanks. Here is the partial of my code: 'ProductValue is location for the data wish to update. rsProducts.MoveFirst For I = 1 To (ProductValue - 1) rsProducts.MoveNext 'MsgBox "Product Value", vbOKOnly, I Next I rsProducts.Edit rsProducts!StockUnit = UpdatedStockUnit rsProducts.Update rsProducts.Close Your help is very appreciated. Thanks. Best Regards, C.K. |
#2
|
|||
|
|||
Recordset MoveNext Problem. Please Help.
Hi C.K.,
You should really post this in an Access newsgroup, not here. Firstly because it has nothing to do with Word but, more importantly, from your point of view, that is where the Access experts are likely to be found. That said, my Access skills are rusty but all I have is questions for you as there is nothing in your posted code to suggest either what should happen or what is happening. So what exactly happens? Does your msgbox tell you anything? Are the MoveNexts doing anything? Which wrong record is being updated - the one after the correct one? Or the one before? Or the first one? Or the last one? Is the recordset in ProductValue order? Should it be? Also, are you using DAO or ADO? And anything else that might give me a fighting chance of identifying your problem. And wouldn't a Seek be a better way of identifying the right record? Walking the recordset from the beginning every time isn't usually an effective way of working.. -- Enjoy, Tony "CK NG" wrote in message ... Hi All, I having a problem with using the recordset .MoveNext in access. I have a form and using Combo Box to select and update data to certain table. But i having a problem with using .MoveNext function. Eventhough i able to detect the location where the data should be updated. When i use the .MoveNext Function to access it, it always updated the wrong row of data. Can anyone advice how to solve this problem? Thanks. Here is the partial of my code: 'ProductValue is location for the data wish to update. rsProducts.MoveFirst For I = 1 To (ProductValue - 1) rsProducts.MoveNext 'MsgBox "Product Value", vbOKOnly, I Next I rsProducts.Edit rsProducts!StockUnit = UpdatedStockUnit rsProducts.Update rsProducts.Close Your help is very appreciated. Thanks. Best Regards, C.K. |
#3
|
|||
|
|||
Recordset MoveNext Problem. Please Help.
It sounds as if your question is about Access. This newsgroup is for new
users of Microsoft Word. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "CK NG" wrote in message ... Hi All, I having a problem with using the recordset .MoveNext in access. I have a form and using Combo Box to select and update data to certain table. But i having a problem with using .MoveNext function. Eventhough i able to detect the location where the data should be updated. When i use the .MoveNext Function to access it, it always updated the wrong row of data. Can anyone advice how to solve this problem? Thanks. Here is the partial of my code: 'ProductValue is location for the data wish to update. rsProducts.MoveFirst For I = 1 To (ProductValue - 1) rsProducts.MoveNext 'MsgBox "Product Value", vbOKOnly, I Next I rsProducts.Edit rsProducts!StockUnit = UpdatedStockUnit rsProducts.Update rsProducts.Close Your help is very appreciated. Thanks. Best Regards, C.K. |
#4
|
|||
|
|||
Recordset MoveNext Problem. Please Help.
Hi Ck,
I having a problem with using the recordset .MoveNext in access. I have a form and using Combo Box to select and update data to certain table. But i having a problem with using .MoveNext function. Ummmm. This is a WORD.Newusers newsgroup? Perhaps you should ask this in an ACCESS group dedicated to programming (VBA or DAO or ADO) FWIW I don't understand how you're using the MoveNext function in this context. I should rather think you ought to be able to access the record directly, using a primary key. but in any case, I'd check whether the records are sorted the same way as they appear in your list vs. the order they're in in the recordset, if you're always getting the "wrong" record, and there's no pattern to it. Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
passing a recordset | 85ascMcLaren | Setting Up & Running Reports | 1 | August 6th, 2005 04:16 PM |
Office XP Update Problem | Bill | General Discussions | 0 | December 1st, 2004 06:11 PM |
Big Problem. We need the fix | Captain K | Calendar | 0 | July 8th, 2004 04:50 PM |
Productkey problem when installing office 2003 on network | Stefan Schreurs | Setup, Installing & Configuration | 1 | June 1st, 2004 11:16 PM |
word error | mac | General Discussions | 1 | May 6th, 2004 08:14 AM |