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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autofit in subforms?

Status
Not open for further replies.

mattpearcey

Technical User
Mar 7, 2001
302
GB
I have a sub form set up to record news items for particular banks. As far as the form goes, it is fine. But As you may guess, the size (amount of data) from news stories varies. So I have had to set a height in the cells to a relatively large level. But in some cases, the story doesn't need that amount of space, and in otheres it needs more. Thus, the users has to use arrow keys to go up and down the article. I was wondering if there is an autofit so the cell will go to the height that is appropriate for the data inserted? I have tried properties but all you can do there is adjust the height. I have also tried to put scroll bars within the cells but failed. Any help?

Its using access 97

Thank you for your help already.

Matt Pearcey
 
Hi Matt,
I've had a problem similar to this before. Here's a solution.
You can create a command button or run from the "double-click" event on your field that open a "zoom" form. I choose a zoom form over the Shift+F2 zoom window because you can make it really big, make it enabled or disabled, make it fancy or whatever:

Build a form using the wizard based off of the same table as your first form. All you need is your banks ID or Note ID field, and the stories field. With this new form in design view make the ID number invisible or show it if you want. You decide if your users can only read or can edit by locking the stories field. Make the form a popup, with a dialog border and either make a close command button or leave the regular x functioning. You might choose to make this form Modal so the user has to close it before doing anything else.

Soooo,
In your button or double-click event add something like this:

DoCmd.OpenForm "NameOfZoomForm", , , "[BankIDNumberFieldOnZoomForm]=" & Me![BankIDNumberOnMainForm]

(I'm assuming the bank ID is the connection but I'm sure you can figure that part out if its a note ID).

Works like a champ for me...Give it a go! Gord
ghubbell@total.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top