Nothing ever equals Null . You have to use
If IsNull(Me.Alt) Then ...
Nothing ever equals Null . You have to use
If IsNull(Me.Alt) Then ...
DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
Please use the star below the post to say thanks if we have helped !
↓↓ It's down here ↓↓
Did you try my suggestion, there is no need for VBA here....
Cheers,
Thanks. I tried that but am now getting #type! at every iteration. I checked and re-checked to make sure that the syntax was correct and it is. Obviously I am still missing something. The two source fields are of type Short Text.
Can you please upload a screenshot of the report in design view with the text box and its associated Properties window with the Control Source?
Cheers,
You need to rename the textbox from Term to txtTerm or something else, the #Type is caused by circular reference, please see the attached sample.
Cheers,
Yes, that was it. The database field was named 'Term' and the name automatically was re-used by the report wizard to name the text box. I renamed it as suggested and it now works. I thought it was something silly like that, just couldn't see it.
This is getting very close. Thank you for the suggestions. One final part of the puzzle now that Term and Subject data are in one text box, is how to format the subject text within the brackets to make it italics. Any formatting now seems to be applied to the whole text box. Would this be a job for conditional formatting or some other feature else?
I will continue with this again tomorrow. Thanks.
I did wonder whether it was possible to insert some kind of markup but I didn't change the Text format to Rich Text. That made all of the difference. Thank you.
Ok, so the final part of the puzzle is this - when printing a report, how do I get a field to print such that the complete text is printed?
Currently, for the description field, the text gets truncated and only part of the first line gets printed. How do I get it to automatically expand and print the full content of the field?
This is a long text field and may contain several sentences or even multiple paragraphs. I have both Can Grow and Can Shrink properties test to 'Yes'.
UPDATE: I *think* I may have found the answer. The Can Grow and Can Shrink properties of the report field need to be set to 'Yes' as well. This works on the sub-report, but now I can't get the main report to do a print preview. It is asking me for the value of the Term field and complains that some macro could not be executed. I don't have any macros defined AFAIK and can't find what is causing this.
Ok, I think I solved it. There was some code in VBA that I added earlier for debug purposes. I removed that and it now works OK.
Just one final detail to sort, which is how to remove/hide the horizontal scroll bars from the sub-report.
Change the Scroll Bars setting on the Format tab of the sub reports property sheet.
If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
Bob Fitzpatrick
Thank you. I spent a long time searching but could not find the ScrollBars setting. Eventually I discovered that if one selects Layout View and then clicks the sub-report to select it, the ScrollBars property then magically appears in the properties list! The ScollBars property can then be set to 'None' and both scrollbars disappear. The Control bar then appears from underneath the horizontal scrollbar! One then has to set the ControlBar property to 'No' and that disappears as well, but only after closing the report layout view, saving and and opening it again. I presume this is a design oversight along with the horrible scrolling glitches which cause only part of the form to scroll leaving two thirds from the left static. Very frustrating!