Can't Grow & Can't Shrink don't work properly

On a single form, I use a multiple unbound textboxes and populate them via DLookups.

In some instances the text does not fit into the size (height) of the textbox.   I chosen "Can Grow" & "Can Shrink" in the textboxes' properties; however, they don't change size depending on the length of text.

Is this because I'm using DLookups?   If yes, is there a way to work-around this?

Thanks,
Tom
TomBock2004Asked:
Who is Participating?
 
tbsgadiConnect With a Mentor Commented:
Hi tom
Checkout http://www.lebans.com/autosize_textbox.htm

Good Luck!

Gary
0
 
TomBock2004Author Commented:
Is there a way to change the PC's screen resolution automatically when opening up an Access database.  For instance, if the users default resolution is 1024 x 768 pixels, I want them to change resolution to e.g. 1280 by 1024 pixels when viewing forms in the db.

Now, once they close the db, the screen resolution should go back to 1024 x 768 pixels.   Is that possible?

Tom
0
 
peter57rCommented:
Hi TomBock2004,

Can Grow and Can Shrink only apply if you PRINT the form.  They do not apply in Form view.

Pete
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
TomBock2004Author Commented:
Dannywareham:

I checked out your 2nd URL... I need some additional help with the "ADHResizeTest2K.zip" sample db.

Here's what I've done:
- Read the PDF
- Opened the "ADHResizeTest2K.mdb" as well as my database
- In my database, create a reference to "ADHResize2K.mde"
- From sample database (ADHResizeTest2K), opened up form "frmScaleTest"
- With the exception of the "Form_Load" (I already have this event in my form),
  I copied the entire VBA code from "frmScaleTest" and placed it into my form
- Now, I copied the 3 lines from function "Form_Load" and added them to my existing
  "Form_Load" code (at the beginning of the function).
- In my form -- from the Debug window -- compiled the form

Here's now the problem:
- When compiling the form, the 2nd line of the code below is highlighted.  It indicates
that there is a compile error and highlights "chkScaleColumns".

***
Private Sub chkScaleColumns_Click()
    If chkScaleColumns Then
***


What am I missing?


Tom  
   
   
0
 
dannywarehamCommented:
In the example, "chkScaleColumns" is the name of the control (the check box on the example form).

Try changing to this:

Private Sub chkScaleColumns_Click()
frmResize.ScaleColumns = True
        frmResize.RescaleForm
End Sub


That will resize the form

You will also notice that if you restore the form, it will adjust size again...

:-)
0
 
TomBock2004Author Commented:
Dannywareham:

Thanks for the prompt feedback... after I posted this question, I reread the PDF instructions again.

Here's what I concluded... I simply need to copy the code below into my form:

**************
Private frmResize As ADHResize2K.FormResize

Private Sub Form_Open(Cancel As Integer)
   
    Set frmResize = ADHResize2K.CreateFormResize()
    Set frmResize.Form = Me
    Call frmResize.SetDesignCoords(1280, 1024, 96, 96)
       
End Sub
**************

Assuming that this is correct, I still have a problem w/ the form.   Once I open it (w/ only the Resize code listed above; between ***s), all of my DLookups don't not show data in their textboxes any longer.   Essentially, it appears that the form is locked.

To recap:
What do you recommend to put in my form's application in order to differentiate between different screen resolutions so that the form can grow and shrink.

Any recommendations?

Tom
0
 
TomBock2004Author Commented:
... I think the last statement "so that the form can grow and shrink" could be confusing.  I meant to say that I can see all controls on the form, no matter what the screen resolution is.

Tom
0
 
dannywarehamCommented:
>>all of my DLookups don't not show data in their textboxes any longer

Where is the code for these DLOOKUPs?
If they're in code, they should be in the OnCurrent or OnOpen events (I presume?)
0
 
dannywarehamCommented:
The example that you have will change teh form resolution to fit, no matter what resolution the screen is actually set at - and will show all controls.

:-)
0
 
TomBock2004Author Commented:
Dannywareham:

Thanks... follow-up question for clarification... it'll best described via an example

- I have a laptop w/ a resolution of 1024 x 768 pixels
- most users on our network have a resolution of 800 x 600 on their PCs
- now, on the laptop, when I open the form, a have a bunch of gray space in the right section of the form (next to my last control)
- on the PC, all gray space is gone.  As a matter of fact, I need to use the horizontal scroller to see the last control.

Just in the sample that you referred to, no matter what system the form is being viewed at, the spacing is equivalent between the 3 view methods (laptop vs. PC).   The only thing that changes is e.g. the size of a frame of textbox.   I want to replicate this for my form.   Right now, it doesn't do that.

Any final comments.   BTW, I raised the points to 500.

Tom
0
 
dannywarehamCommented:
OK.
In the code to call the form control, do you have a DoCmd.Maximise or a DoCMd.Restore?

It was my understanding that the form resized automatically when it was resized - it works on my downloaded example.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.