SOLVED

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

%3CLINGO-SUB%20id%3D%22lingo-sub-1166199%22%20slang%3D%22en-US%22%3ECheckbox%20or%20button%20on%20Report%20which%20update%20the%20data%20and%20refresh%20through%20form%20(MS%20Access)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1166199%22%20slang%3D%22en-US%22%3E%3CP%3Ehy%20buddies%20help....%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ewe%20cant%20directly%20put%20any%20data%20in%20MS%20access%20report.%20we%20have%20to%20goto%20table%20or%20form%20first%20then%20update%20any%20data.%20but%20can%20anyone%20tell%20me%20that%20if%20a%20table%20name%20is%20%3CSTRONG%3E123table%3C%2FSTRONG%3E%20or%20a%20form%20name%20%3CSTRONG%3Eform456%3C%2FSTRONG%3E%20i%20want%20make%20a%20checkbox%20or%20button%20on%20%3CSTRONG%3Ereport%3C%2FSTRONG%3E%20to%20update%20and%20refresh%20data%20.%20is%20it%20possible%20if%20yes%20then%20how%20for%20example%20i%20am%20coding%20like%20this%20but%20its%20not%20working%20because%20i%20dont%20know%20how%20to%20explore%20table%20or%20form.%3C%2FP%3E%3CP%3Eif%20checkbox%20%3D%20uncheck%20then%3C%2FP%3E%3CP%3Eform!form456!textbox!Price%20%3D%20Form!form456!Paid%3C%2FP%3E%3CP%3Edocmd.refresh%3C%2FP%3E%3CP%3Eelse%3C%2FP%3E%3CP%3Eform!form456!textbox!Price%20%3D%20%220%22%3C%2FP%3E%3CP%3EEnd%20sub%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ecorrect%20me%20in%20coding.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1166199%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAccess%20form%20report%20checkbox%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1166604%22%20slang%3D%22en-US%22%3ERe%3A%20Checkbox%20or%20button%20on%20Report%20which%20update%20the%20data%20and%20refresh%20through%20form%20(MS%20Access)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1166604%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F551570%22%20target%3D%22_blank%22%3E%40ZKMPk%3C%2FA%3E%26nbsp%3BReports%20are%20NOT%20used%20to%20input%20data.%20Reports%20ONLY%20display%20data.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20must%20manage%20your%20data%20through%20forms.%20Forms%20ARE%20used%20to%20input%20data.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1168520%22%20slang%3D%22en-US%22%3ERe%3A%20Checkbox%20or%20button%20on%20Report%20which%20update%20the%20data%20and%20refresh%20through%20form%20(MS%20Access)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1168520%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F46682%22%20target%3D%22_blank%22%3E%40George%20Hepworth%3C%2FA%3E%26nbsp%3BI%20know%20this%20brother.%20but%20i%20want%20make%20a%20checkbox%20on%20report%20which%20i%20check%20or%20uncheck%20and%20the%20data%20update%20from%20form%20is%20it%20possible%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1169668%22%20slang%3D%22en-US%22%3ERe%3A%20Checkbox%20or%20button%20on%20Report%20which%20update%20the%20data%20and%20refresh%20through%20form%20(MS%20Access)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1169668%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F551570%22%20target%3D%22_blank%22%3E%40ZKMPk%3C%2FA%3E%26nbsp%3BI'm%20sorry.%20I%20thought%20I%20was%20clear.%20Reports%20DISPLAY%20data.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1172182%22%20slang%3D%22en-US%22%3ERe%3A%20Checkbox%20or%20button%20on%20Report%20which%20update%20the%20data%20and%20refresh%20through%20form%20(MS%20Access)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1172182%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F46682%22%20target%3D%22_blank%22%3E%40George%20Hepworth%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESorry%20George%20but%20you%20can%20use%20buttons%20on%20reports.%20They%20will%20be%20visible%20and%20usable%20on%20reportmode.%20You%20are%20right%20when%20you%20mean%20that%20you%20can%20not%20use%20them%20on%20printpreview.%26nbsp%3B%3C%2FP%3E%3CP%3EThey%20come%20in%20handy%20when%20you%20want%20to%20show%20a%20preview%20with%20options%20for%20different%20kind%20of%20versions.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGreetings%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMarcel%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1172249%22%20slang%3D%22en-US%22%3ERe%3A%20Checkbox%20or%20button%20on%20Report%20which%20update%20the%20data%20and%20refresh%20through%20form%20(MS%20Access)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1172249%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F551570%22%20target%3D%22_blank%22%3E%40ZKMPk%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20button%20will%20only%20work%20in%20reportmode%20not%20in%20printpreview.%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20you%20are%20putting%20the%20button%20keep%20in%20mind%20that%20the%20report%20has%20the%20information%20from%20the%20table's%20when%20it%20was%20opened.%20So%20the%20button%20can%20change%20the%20values%20in%20the%20form%20but%20you%20need%20to%20reload%20the%20report.%20I%20am%20not%20covering%20the%20part%20that%20the%20report%20needs%20to%20be%20closed%20and%20opened%20again.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ecall%20to%20the%20textfield%20would%20go%20like%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eif%20checkbox.value%20%3D%20false%20then%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3Bforms(%22form456%22).textbox.Price.text%20%3D%20forms(%22form456%22).Paid.text%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B'not%20sure%20if%20the%20line%20below%20will%20do%20the%20job.%20Try%20and%20let%20us%20know%20here.%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20docmd.requery%3C%2FP%3E%3CP%3Eelse%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3Bforms(%22form456%22).textbox.Price.text%20%3D%200%3C%2FP%3E%3CP%3EEnd%20sub%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional 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
Highlighted

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

Highlighted

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

Highlighted

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

 

 

Highlighted

@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

 

 

Highlighted
Best Response confirmed by ZKMPk (Occasional 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