Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.newusers
|
|||
|
|||
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
Posted to microsoft.public.word.newusers
|
|||
|
|||
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
Posted to microsoft.public.word.newusers
|
|||
|
|||
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
Posted to microsoft.public.word.newusers
|
|||
|
|||
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 :-) |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Problem with Normal.dot or formatting??? | Microsoft Word Help | |||
Comments and tables problem in Word 2003 | Microsoft Word Help | |||
Problem with Textboxes | Page Layout | |||
Attaching Expansion Pack to Word Documents - Puzzling Problem | Microsoft Word Help | |||
Word User Network Problem | Microsoft Word Help |