Feb 11 2020 03:24 AM
hy buddies help....
we cant directly put any data in MS access report. we have to goto table or form first then update any data. but can anyone tell me that if a table name is 123table or a form name form456 i want make a checkbox or button on report to update and refresh data . is it possible if yes then how for example i am coding like this but its not working because i dont know how to explore table or form.
if checkbox = uncheck then
form!form456!textbox!Price = Form!form456!Paid
docmd.refresh
else
form!form456!textbox!Price = "0"
End sub
correct me in coding.
Feb 11 2020 06:18 AM
@ZKMPk Reports are NOT used to input data. Reports ONLY display data.
You must manage your data through forms. Forms ARE used to input data.
Feb 11 2020 08:09 PM
@George Hepworth I know this brother. but i want make a checkbox on report which i check or uncheck and the data update from form is it possible?
Feb 12 2020 08:03 AM
Feb 13 2020 08:33 AM
Sorry George but you can use buttons on reports. They will be visible and usable on reportmode. You are right when you mean that you can not use them on printpreview.
They come in handy when you want to show a preview with options for different kind of versions.
Greetings,
Marcel
Feb 13 2020 08:52 AM
Solution
The button will only work in reportmode not in printpreview.
When you are putting the button keep in mind that the report has the information from the table's when it was opened. So the button can change the values in the form but you need to reload the report. I am not covering the part that the report needs to be closed and opened again.
call to the textfield would go like this:
if checkbox.value = false then
forms("form456").textbox.Price.text = forms("form456").Paid.text
'not sure if the line below will do the job. Try and let us know here.
docmd.requery
else
forms("form456").textbox.Price.text = 0
End sub
Feb 13 2020 08:52 AM
Solution
The button will only work in reportmode not in printpreview.
When you are putting the button keep in mind that the report has the information from the table's when it was opened. So the button can change the values in the form but you need to reload the report. I am not covering the part that the report needs to be closed and opened again.
call to the textfield would go like this:
if checkbox.value = false then
forms("form456").textbox.Price.text = forms("form456").Paid.text
'not sure if the line below will do the job. Try and let us know here.
docmd.requery
else
forms("form456").textbox.Price.text = 0
End sub