Solved

update not working in filtered subform

Posted on 2013-06-10
6
319 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

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 500 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

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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 …
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

624 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