Forum Discussion

ZKMPk's avatar
ZKMPk
Copper Contributor
Feb 11, 2020
Solved

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

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.

  • 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

     

     

5 Replies

  • testmuts's avatar
    testmuts
    Brass Contributor

    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

     

     

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

    • ZKMPk's avatar
      ZKMPk
      Copper Contributor

      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?

Resources