![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Can anyone help me with a function to get the useable screen size i.e. minus any toolbars or ribbons (if showing), minus navigator pane (if showing) and minus the strip at the bottom of the screen. That way I can get a form to fill the screen vertically (I don't want it maximised, only the correct height. Unfortunately, Restore doesn't seem to work for forms in a referenced database. Thanks Phil |
#3
| |||
| |||
|
|
On Feb 18, 12:06*pm, "Phil" <p... (AT) stantonfamily (DOT) co.uk> wrote: Can anyone help me with a function to get the useable screen size i.e. mi nus any toolbars or ribbons (if showing), minus navigator pane (if showing) a nd minus the strip at the bottom of the screen. That way I can get a form to fill the screen vertically (I don't want it maximised, only the correct height. Unfortunately, Restore doesn't seem to work for forms in a refere nced database. Thanks Phil Hi Phil, Because my generalized forms look quite differently in design mode than in user mode, I tune every form in place and size. For that purpose I use, as one of the last statements in the OnOpen event: DoCmd.MoveSize Left, Up, Width, Height Imb. |
#4
| |||
| |||
|
|
What I am trying to achive is that continuous forms open to the correct size. If say there is a header 1" high, and each detail row is 1/4" high and there are 8 records, I want the form to open to 3" (1" + 8 * 1/4") If on the other hand there ar 400 records, then the form should be 101" long. This obviously is too long for the screen, so I want to set the form length to the screen size. I know I don't have to remind Imb, but let me stress that this formis in the referenced database. |
#5
| |||
| |||
|
|
What I am trying to achive is that continuous forms open to the correct s ize. If say there is a header 1" high, and each detail row is 1/4" high and th ere are 8 records, I want the form to open to 3" (1" + 8 * 1/4") If on the ot her hand there ar 400 records, then the form should be 101" long. This obviou sly is too long for the screen, so I want to set the form length to the scree n size. I know I don't have to remind Imb, but let me stress that this form is in the referenced database. Hi Phil, The maximum number of records you can display, can be calculated very easily: Nmax = Height_form(wanted) – Height_header – Height_footer / (Height_per_record + Record_distance) To calculate the actual height of the form to be used, you use: N = Minimum(Number_of_records,Nmax) Height_form = Height_header + Height_footer + N*(Height_per_record + Record_distance) For continuous forms I normally do not change the height of the form, but I change the width of the form depending on the width of the used fields. In a Single_form (to display/edit a single record) I have the fields vertical, and I adjust the height of the form according to above mentioned rules (Height_per_field instead of Height_per_record). The same holds for a New_form, to edit/define a new record. In my approach I do not need to correct for banner or nav pane, because I do not use them. In the StartupForm all necessary functionality is available to navigate through the application, so I do not need the nav pane. In the same way all necessary functionality of the banner is already build in in the standarized forms that I use. Imb. |
#6
| |||
| |||
|
|
..., so I still need the height of the screen to establish whether all the records can be displayed, or only those that will fit on the screen. Thanks again Phil- Hide quoted text - - Show quoted text - |
#7
| |||
| |||
|
|
..., so I still need the height of the screen to establish whether all the records can be displayed, or only those that will fit on the screen. Thanks again Phil- Hide quoted text - - Show quoted text - Hi Phil, Perhaps I do not understand your question: “I still need …” If the maximum number of records you can display is 20, then you calculate the height of the form for 20 records if there are more than 20 records in your recordset, else you calculate the height of the form for the actual number of records in the form. In fact this is the minimum value of the number of record and 20. Imb. |
#8
| |||
| |||
|
|
On 21/02/2011 11:47:54, imb wrote: ..., so I still need the height of the screen to establish whether all the records can be displayed, or only those that will fit on the screen. Thanks again Phil- Hide quoted text - - Show quoted text - Hi Phil, Perhaps I do not understand your question: “I still need …” If the maximum number of records you can display is 20, then you calculate the height of the form for 20 records if there are more than 20 records in your recordset, else you calculate the height of the form for the actual number of records in the form. In fact this is the minimum value of the number of record and 20. Imb. Imb Of course you are right I am getting thick. Put it down to old age. Thanks again Phil |
#9
| |||
| |||
|
|
On 21/02/2011 12:57:44, "Phil" wrote: On 21/02/2011 11:47:54, imb wrote: ..., so I still need the height of the screen to establish whether all the records can be displayed, or only those that will fit on the screen. Thanks again Phil- Hide quoted text - - Show quoted text - Hi Phil, Perhaps I do not understand your question: “I still need …” If the maximum number of records you can display is 20, then you calculate the height of the form for 20 records if there are more than 20 records in your recordset, else you calculate the height of the form for the actual number of records in the form. In fact this is the minimum value of the number of record and 20. Imb. Imb Of course you are right I am getting thick. Put it down to old age. Thanks again Phil |
#10
| |||
| |||
|
|
Having thought about it again, maybe I'm not so senile after all. The maximum height of the form is limited by the screen size, hence my question. The useable screen size is governed by such things as screen resolution and what is showing other than the form (Nave Pane & ribbon are the obvious ones) That is why I attempted to use the code posted earlier to get the screen size. Cheers Phil- |
![]() |
| Thread Tools | |
| Display Modes | |
| |