Full Version: error in subform
UtterAccess Forums > Microsoft® Access > Access Forms
i had form linked with subform.
Otry to update value of one of record in subform.

i use code in command button (on click)...

me.booksubforms.form!status.value = "no"

but when click it, it not change. (i mean record data in table not change)

i not use direct table but i use query in subform control source.

please help


Edited by: bayfx on Tue Aug 19 23:16:18 EDT 2008.
Is the button on the main form or the subform? Is the subform bound to the table? Is the "status" field a boolean data type?
the button is on form
The subform using query of 2 table.... and relationship "1" to "many". with cascade update and cascade delete
which "the-need updated record" is in "1" table.
status is combo box with "value" (yes, no, not active..... )
Osucessful try to use command with
me.status.value = "no"
in subform (but when it not connected with master form)
please help
Can you post a small copy of your db with test data?
sorry i late to reply... i need to edit some part...

this is my "edited" copy of my db.

some of part still using "my mother" language. but i have edited and translate it also make description, to make easier to understand my problem.
but fell free to ask if you need the translate.


Edited by: bayfx on Thu Aug 21 7:37:52 EDT 2008.
no solution.....?
tried other methode....... please see my attachment
Otried to change in "subform" -Got focus with code " me.status.value = "no" but when i cancel/ delete, the record data (status field) still "no". i want if its delete, it "no" change back to "yes".
please help....
Sorry for the delay, I got busy doing something else.
hich form should I look at, and what is your database used for?
To fully understand your problem, I'll need you to tell me, step by step, how to duplicate your problem.
In any case, I looked at your code behind the "Save & Exit" button. Try changing your code from:
Me.book.Form!Status.Value = "No"
to simply:
Me.Status.Value = "No"
and see if that works.
Hope that helps...
it not work... because "status" field is in subform....
My the ways, i had another approach... using stock (like inventory stock) method. not quite same what i need but it work in same way
but thanks anyway.... your answer before open new posibilities..... thanks
Okay, sorry I'm not much help. Glad to hear you found a solution that works for you. Good luck with your project.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.