reference items on a form from report

bigmac

Registered User.
Local time
Today, 02:55
Joined
Oct 5, 2008
Messages
302
hi all , can you help please, I have a report [mainrpt] and a form [mainform] the report loads the info from a subform , what I am trying to do is on load look at the mainfom and see if a tickbox is true or false , and then place the answer in a columnhidden to hide or show it, ive tried this the on load of the report but no good .

if me.tickbox = false then (think this is where I am going wrong , need to point it to maniform)
me . [column1]. columnhidden = true
end if
can you help please:confused:
 
reference items on the form using the full path. *(use the picker, it will show you the path)
forms!myForm!txtBox

But rather than do it in the report, I put it in the query, then bind the report field to the query.
 
thanks ranman256 , but what do you mean by the picker?
 
You can build the correct syntax, to address the open Form based control, if you are not sure how to write it directly, using the Expression Builder (Ranman256 meant by the term picker).

Use the following method to do a trial run:

  1. Open your Main Form in Normal View.
  2. Open another Form with a textbox in design view.
  3. Select the textbox and display the property sheet (F4).
  4. Click on the Control Source Property. You will find the build button (...) at the right side of the property.
  5. Click on it to open the Expression Builder.
  6. Click on the + sign of Forms in the left panel to expand it.
  7. Click on loaded forms and select the Main Form you have opened earlier.
  8. Click on a Textbox in the middle panel.
  9. Click on the Paste button above to paste the textbox's address in the above window.

You have the full address of the Textbox you have selected on the Main Form.
You may write it down for reference. You may click on Cancel button to exit the Expression builder without saving the data on the Textbox on the Form under design view.

I have attached a screen shot of the expression builder for reference.
 

Attachments

  • Expression Builder.jpg
    Expression Builder.jpg
    70.2 KB · Views: 110
thank you apr pillai for your help , but I am running access 2016 and on this expression builder does not show a paste option
 
thank you apr pillai for your help , but I am running access 2016 and on this expression builder does not show a paste option

I don't see that in Access 2013 either but you can double click on the Expression Category you want and it will put the reference in the window. Below I justed double clicked on chkBox and Forms![Form1]![chkBox] appeared in the window

attachment.php
 

Attachments

  • Expression Builder.png
    Expression Builder.png
    29.6 KB · Views: 184

Users who are viewing this thread

Back
Top Bottom