0
votes

I have developed an MS access application which contains multiple forms and sub-forms with tab view in it. This application looks fine in my system but in my client's monitor it is showing a blank space in right side after the application. I tried googling and found DoCmd.Maximize property but it did not workout as it is not working in sub-forms. Please suggest me what can i do so that my application fits in any resolution screen.

1
Ms Access is not fluid/responsive. You can use Anchors to dock controls on the screen. - Krish
Or use the Peter's ShrinkerStretcher. - Gustav
@Gustav: 40$ per client! That's not cheap... - Patrick Honorez
@PatrickHonorez: That depends on how valuable your time is. - Gustav

1 Answers

1
votes

AFAIK, it is the main form that has to handle the width of his subform-control. I do not know if the following can be of any help for you, but if you create a form and put a label on it named SizeProperties_Label, you can paste the following code. It displays some properties while resizing the form. After getting familiar with these properties, perhaps you can apply the resizing of the label in this sample to resizing the subform-control.


Option Compare Database
Option Explicit
Dim mCaptionCounter As Long
Const ConvertTwipsToCm As Long = 567

Private Sub display_Form_Resize()
Dim S As String

    mCaptionCounter = mCaptionCounter + 1
    S = Now & " -- " & mCaptionCounter & vbCrLf & vbCrLf
    S = S & display_One_Parameter("me top     : ", CDbl(Me.WindowTop / ConvertTwipsToCm), "   ")
    S = S & display_One_Parameter("me left    : ", CDbl(Me.WindowLeft / ConvertTwipsToCm))
    S = S & display_One_Parameter("me height  : ", CDbl(Me.WindowHeight / ConvertTwipsToCm), "   ")
    S = S & display_One_Parameter("me width   : ", CDbl(Me.WindowWidth / ConvertTwipsToCm))
    S = S & display_One_Parameter("me insideh : ", CDbl(Me.InsideHeight / ConvertTwipsToCm), "   ")
    S = S & display_One_Parameter("me insidew : ", CDbl(Me.InsideWidth / ConvertTwipsToCm))

    With SizeProperties_Label
    S = S & display_One_Parameter("lbl top    : ", CDbl(.Top / ConvertTwipsToCm), "   ")
    S = S & display_One_Parameter("lbl left   : ", CDbl(.Left / ConvertTwipsToCm))
    S = S & display_One_Parameter("lbl height : ", CDbl(.Height / ConvertTwipsToCm), "   ")
    S = S & display_One_Parameter("lbl width  : ", CDbl(.Width / ConvertTwipsToCm))
    End With    
    SizeProperties_Label.Caption = S
End Sub

Private Function display_One_Parameter(MeText As String, D As Double, Optional EndText As String = vbCrLf) As String
    display_One_Parameter = MeText & Format(D, "0.00") & EndText
End Function

Private Sub perform_Form_Resize_Gamma()
Dim L As Long

    On Error Resume Next
    L = (Me.InsideHeight):     Debug.Print Format(L, "#.##")
    Me.SizeProperties_Label.Top = L * 0.05 ' can cause error [2100], so, for now, resume next
    Me.SizeProperties_Label.Height = L * 0.9

    L = (Me.InsideWidth):     Debug.Print Format(L, "#.##")
    Me.SizeProperties_Label.Left = L * 0.05 ' can cause error [2100], so, for now, resume next
    Me.SizeProperties_Label.Width = L * 0.9

End Sub

Private Sub Form_Resize()
    Call display_Form_Resize
    Call perform_Form_Resize_Gamma
End Sub
Private Sub Details_Click()
    Call display_Form_Resize
End Sub
Private Sub Form_Click()
    Call display_Form_Resize
End Sub
Private Sub Form_Load()
    mCaptionCounter = 0
End Sub
Private Sub SizeProperties_Label_Click()
    Call display_Form_Resize
End Sub