Shinta
Registered User.
- Local time
- Today, 12:36
- Joined
- Jan 11, 2012
- Messages
- 48
Greetings:
Perhaps I'm violating some good practices / forum norms, for the title of the post: please let me know how can I improve it
My issue I ask for help, is of a saved query which I would like to emulated with VBA.
The whole idea is to update a set of a table's fields based in the status of a control at a form; when the condition is met, the query takes the value of another field for doing the updates.
The original saved query is: UPDATE EntradaPatiosDetalle SET EntradaPatiosDetalle.precio = IIf([Forms]![EntradaPatios]![patioCheckBox]=True,[precio_patio],[precio_pyme])
WHERE (((EntradaPatiosDetalle.idEntrada)=[Forms]![EntradaPatios]![idEntrada]));
The closest approach I can get to at VBA (which fails
), is: CurrentDb.Execute "UPDATE EntradaPatiosDetalle SET [precio] = " & IIf([Forms]![EntradaPatios]![patioCheckBox] = True, [precio_patio], [precio_pyme]) & ", [mayoreoCheckBox] = Null WHERE [idEntrada] = " & Me.idEntrada
I'm sure that the problem is at the code maked in bold..
Any ideas?
Thanks a lot in advanced; regards
Perhaps I'm violating some good practices / forum norms, for the title of the post: please let me know how can I improve it
My issue I ask for help, is of a saved query which I would like to emulated with VBA.
The whole idea is to update a set of a table's fields based in the status of a control at a form; when the condition is met, the query takes the value of another field for doing the updates.
The original saved query is: UPDATE EntradaPatiosDetalle SET EntradaPatiosDetalle.precio = IIf([Forms]![EntradaPatios]![patioCheckBox]=True,[precio_patio],[precio_pyme])
WHERE (((EntradaPatiosDetalle.idEntrada)=[Forms]![EntradaPatios]![idEntrada]));
The closest approach I can get to at VBA (which fails
I'm sure that the problem is at the code maked in bold..
Any ideas?
Thanks a lot in advanced; regards