Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

update not working in filtered subform

Posted on 2013-06-10
6
Medium Priority
?
325 Views
Last Modified: 2013-06-26
May a help, what i`m doing wrong, in the attached sample, in the FrmUpdateStructure form
i choose to filter:
storage name=1
shelfFrom=1
shelfUntil=5
cellName=1
i got 5 rows.
now choose in the cmocondition=Not counted, and click "CmdUpdate"
i doesn`t update only the filtered row, it updates all the rows !
it also changes the cmocondition value "Not Suitable" to a "Not counted"

also i`ll appertiate haven better way to filter rows from combobox than my way in doing it.
SmartStorage.accdb
0
Comment
Question by:drtopserv
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 12

Expert Comment

by:pdebaets
ID: 39236154
Try this:

Dim rst0 As DAO.Recordset,  Qty As Long, C As Long
Set rst0 = Me!sfmList.Form.RecordsetClone
rst0.MoveFirst
Do While Not rst0.EOF
    rst0.Edit
    rst0!moneycondition = CStr(Nz(Me.cmoCondition.Value, 0))
    rst0.Update
    rst0.MoveNext
Loop

Open in new window

0
 

Author Comment

by:drtopserv
ID: 39236762
Sorry i tied it, didn`t help out:{
0
 

Author Comment

by:drtopserv
ID: 39236771
I think i figure out where is the problem.
the rst0!moneycondition field in the subform is a field from a another table (multitable), means i should have to replace it with conditionID from tblcell . but the problem is that this field is number, i need to put the unbound combobox "Me.cmoCondition" to show me a text values and to insert into the conditionID field a number (means to display a text in the interface but to save a number in the table field)
0
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 

Author Comment

by:drtopserv
ID: 39236834
wow, i think i have found the solution,
i think i should have to write :

rst0!moneycondition = CStr(Nz(Me.cmoCondition.column(0), 0))  instead of :

rst0!moneycondition = CStr(Nz(Me.cmoCondition.Value, 0))
0
 
LVL 12

Accepted Solution

by:
pdebaets earned 2000 total points
ID: 39238476
I had success with the code I posted above. When you tried it, what problem did you have?
0
 

Author Closing Comment

by:drtopserv
ID: 39277652
Anyway, even it was to add little fix, still your code help out..
thnx man:}
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question