SOLVED

Checkbox or button on Report which update the data and refresh through form (MS Access)

Copper Contributor

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.

5 Replies

@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.

@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?

@ZKMPk I'm sorry. I thought I was clear. Reports DISPLAY data. 

 

 

@George Hepworth 

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

 

 

best response confirmed by ZKMPk (Copper Contributor)
Solution

@ZKMPk 

 

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

 

 

1 best response

Accepted Solutions
best response confirmed by ZKMPk (Copper Contributor)
Solution

@ZKMPk 

 

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

 

 

View solution in original post