drtopserv
asked on
Update field in subform from unbound control in main form
HI,
Attached a sample file,
I need to perform update field=CurrencyValue in a subform=subQuery from a button control in main form=form1 where CurrencyValue=
UPDATE currencyvalue field in subquery.form from a value of unbound textbox call txtNewValue.value in main form where currencyvalue fied in subquery = value of the unbound control textbox=txtCurrencyValue
SmartStorageV2.4.accdb
Attached a sample file,
I need to perform update field=CurrencyValue in a subform=subQuery from a button control in main form=form1 where CurrencyValue=
UPDATE currencyvalue field in subquery.form from a value of unbound textbox call txtNewValue.value in main form where currencyvalue fied in subquery = value of the unbound control textbox=txtCurrencyValue
SmartStorageV2.4.accdb
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i`ll post another Q also with 500 points :} , i think it needs more to think :}
No it doesn't.
There is no reason to fool around with slow SQL for this task.
Just copy and paste my code into your button click event.
/gustav
There is no reason to fool around with slow SQL for this task.
Just copy and paste my code into your button click event.
/gustav
ASKER
cactus_data, as i have read from experts they said :
"Don`t use recordset looping and updating to simply update a group of records in a table. it`s much more efficient to build on update query with the same selection criteria to modify the records as a group."
(from the book wrox access 2010 programmer~)
"Don`t use recordset looping and updating to simply update a group of records in a table. it`s much more efficient to build on update query with the same selection criteria to modify the records as a group."
(from the book wrox access 2010 programmer~)
Well, other Experts tell another story.
Why don't you just try? One minute and you are done. It is tested and works at an amazing speed, and you will have learnt something new.
/gustav
Why don't you just try? One minute and you are done. It is tested and works at an amazing speed, and you will have learnt something new.
/gustav
ASKER
yea thnx alot i know the recordset update but i thought it`s agood way to do update through sql.
but anyway thanx alot pals..
i`ll give the point to the 3.
i`ll open a new post in a mins..
i hope someone can the ability to solve it(it`s a continuation Q)
but anyway thanx alot pals..
i`ll give the point to the 3.
i`ll open a new post in a mins..
i hope someone can the ability to solve it(it`s a continuation Q)
Strange. Leaving the solution on the floor and walk away ...
/gustav
/gustav
ASKER
lollllllllll
ASKER
thnx Alotttttttttttttttttttt
<<
"Don`t use recordset looping and updating to simply update a group of records in a table. it`s much more efficient to build on update query with the same selection criteria to modify the records as a group."
(from the book wrox access 2010 programmer~)
>>
The thing here is that they are talking about doing this in general in code and not in a form. When in a form and using the forms recordset, the recordset is already built. Plus you avoid the requery/refresh of the data. I would not use SQL statements in a form unless it was un-bound.
I'm also left wondering if they were not using ADO instead of DAO. DAO is faster then ADO when dealing with recordsets in a JET based DB.
Jim.
"Don`t use recordset looping and updating to simply update a group of records in a table. it`s much more efficient to build on update query with the same selection criteria to modify the records as a group."
(from the book wrox access 2010 programmer~)
>>
The thing here is that they are talking about doing this in general in code and not in a form. When in a form and using the forms recordset, the recordset is already built. Plus you avoid the requery/refresh of the data. I would not use SQL statements in a form unless it was un-bound.
I'm also left wondering if they were not using ADO instead of DAO. DAO is faster then ADO when dealing with recordsets in a JET based DB.
Jim.
ASKER
but is there away to write a line like the one written by baderms1959 :
strSQL = "UPDATE tblCell SET CurrencyValue = " & txtNewValue & " WHERE CurrencyValue=" & txtcurrencyvalue
and change the tblcell to -> Query.Query1