Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying more than one record in a single field 3

Status
Not open for further replies.

spherey

Technical User
Jun 24, 2003
80
US
This is either going to be a very odd question or a very simple one. I have a report which is built upon a query which draws from more than one table. One table is "company information", and the other table is "company notes". The company information is always the same, whereas one company can have many different entries into the notes table.

The way the report is currently set up is that for each company, all the information is displayed for each separate note. While it would be easy enough to set all the fields to "Can Shrink" and "Hide Duplicates" so that only the new information (i.e., each individual note) would display, this is not exactly what the company management wants. Rather than having a row of fields for each company's information, and subsequent entries from the "notes" table appearing individually beneath this row of unchanging information, they would like to see ALL the entries from the notes table appear in the same field - that is, whether there is one note, or two, or twelve, they want all of them to appear in the same box, and they'd like the other fields to grow not merely to accomodate their own data, but to match the height of the notes field (which might only be an inch tall for one note, but if a company has several different entries, might be six inches tall instead).
Does anyone have any idea as to how I can go about setting this up? I'm stumped, though I can't help but think that there's probably some easy solution that I'm missing.

Thanks a lot,

Spherey
 
Ken,

Thanks for the references for XP. Those will be handy when I upgrade in the next couple of months!! :)

I figured they be a little different the 2000, but wasn't sure what they'd be. I'm in the middle of testing applications for the upgrade and you just saved me a couple hours of trial and error testing. :)

Spherey,

Try unchecking your last 2 references and see if that makes a difference. Sometimes having too many references causes confusion on the backend.

As far as your external name not defined error --

your line of code reads

variable = field

I think that when you use [] access thinks it's a field not a variable. Try making all of your variables one word each like varCompanyName and don't put [] around your variables.

I could be wrong but it's worth a try.

Twoodd
 
Spherey,

One other thought--if you have option explicit on, you'll have to make sure all of your variables are declared. If you don't have option explicit on, I'd turn it on. It may cause a lot more errors at first - basically letting you know which variables you haven't declared - but it helps a ton in checking typos in your variable names and cleaning up the code.

You can turn it on by going to the top of the code where you see this:

Option Compare Database

and right under it type: Option Explicit
Twood
 
Yes, Twoodd, that's excellent advice. I always use Option Explicit and it really does save a lot of headaches.

Ken S.
 
Hey Twoodd and Ken,

I made some more changes - I made all my variables one word and removed the brackets, and set it to Option Explicit, but I'm still getting that error. It may well be a problem with having too many references, but unfortunately I can't remove the other two, as I need them checked for another module which provides some major functionality to the databases, whereas these would be helpful and handy but would basically be aesthetic changesto make the report look better. I'll keep playing with it, and if I hit on something brilliant that solves the recurring errors, I'll post it here. I certainly don't think the problem is in your advice - it's either in my changes to the names of the variables and fields, or in a conflict with the references. But if I come up with a workaround, I'll pass it on, in case anyone else would have a use for it.

Thanks again to both of you for your time and sleuthing - I very much appreciate it.

- Spherey
 
Spherey,

I tested my example and added the 2 extra references you have and it still works. The references don't seem to be the problem, so I wouldn't worry about that.


TwoOdd
--------------
Good judgment comes from experience, and experience comes from bad judgment.
-- Barry LePatner
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top