?
Solved

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

Posted on 2005-04-19
12
Medium Priority
?
655 Views
Last Modified: 2007-12-19
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
0
Comment
Question by:TomBock2004
12 Comments
 

Author Comment

by:TomBock2004
ID: 13814108
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
 
LVL 77

Expert Comment

by:peter57r
ID: 13814111
Hi TomBock2004,

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

Pete
0
 
LVL 46

Accepted Solution

by:
tbsgadi earned 1500 total points
ID: 13814279
Hi tom
Checkout http://www.lebans.com/autosize_textbox.htm

Good Luck!

Gary
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 26

Expert Comment

by:dannywareham
ID: 13814315
0
 

Author Comment

by:TomBock2004
ID: 13815128
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
 
LVL 26

Expert Comment

by:dannywareham
ID: 13815356
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
 

Author Comment

by:TomBock2004
ID: 13815464
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
 

Author Comment

by:TomBock2004
ID: 13815487
... 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
 
LVL 26

Expert Comment

by:dannywareham
ID: 13815580
>>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
 
LVL 26

Expert Comment

by:dannywareham
ID: 13815594
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
 

Author Comment

by:TomBock2004
ID: 13818071
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
 
LVL 26

Expert Comment

by:dannywareham
ID: 13818121
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

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Suggested Courses
Course of the Month16 days, 16 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question