Results 1 to 3 of 3

Thread: Spacing problem with Access Form

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2021
    Posts
    2

    Spacing problem with Access Form

    Name:  questions.jpg
Views: 727
Size:  17.5 KBName:  gap.jpg
Views: 351
Size:  21.5 KB

    Hello

    I'm new here, so apologies if I've posted in the wrong section. I am not remotely familiar with VB, coming from a perl/web tech background. I am writing an Access 2016 database for my girlfriend who owns a care agency. My problem involves the use of VB in the forms section.

    The form contains a series of questions, Each question has a checkbox which when clicked drops down a further series of questions and another checkbox with further questions. I am using VB to control the actions of the checkboxes i.e hiding the questions underneath the main question. Fully expanded the form looks like (questions.jpg attached), the second question is underneath the last box.
    When the checkboxes are not expanded, I want the second question to be underneath the first question. What I am actually getting is the second question halfway down the page (gap.jpg attached). Could somebody point me in the right direction to achieve this. Can it even be done by adding code to the VB script I am using? Code below.

    Thank you in advance.


    Code:
    Option Compare Database
    
    Private Sub Form_Open(Cancel As Integer)
    'this runs both buttons on open this just syncs the code as it flip flops visibility
    
    Call BreathingProbs_Click
    Call CirculatoryProbs_Click
    
    End Sub
    
    Private Sub BrAss_Click()
    'toggles visibility of text boxes on button press
    
    If Me.BrAss = True Then BrRiskRating.Visible = True
                            BrPaR.Visible = True
                            BrRiskRed.Visible = True
                            BrAction.Visible = True
                            
    If Me.BrAss = False Then
                        
                            BrRiskRating.Visible = False
                            BrPaR.Visible = False
                            BrRiskRed.Visible = False
                            BrAction.Visible = False
                           
    End If
    
    End Sub
                            
    Private Sub BreathingProbs_Click()
    
    'toggles visibility of text boxes on button press
    
    If Me.BreathingProbs = True Then BrDetails.Visible = True
                                     BrDetailsTxt.Visible = True
                                     BrLevel.Visible = True
                                     BrAss.Visible = True
                                     Call BrAss_Click
    If Me.BreathingProbs = False Then
                                      BrDetails.Visible = False
                                      BrDetailsTxt.Visible = False
                                      BrLevel.Visible = False
                                      BrAss.Visible = False
                                      BrRiskRating.Visible = False
                                      BrPaR.Visible = False
                                      BrRiskRed.Visible = False
                                      BrAction.Visible = False
                    
    'last 4 false commands clear up the BrAss toggle as if set to true and you toggle the BrethProbs to false they will get left on screen as the BrAss was not toggled to clean them up
    
    End If
    
    
    End Sub
    'Private Sub Form_Open(Cancel As Integer)
    'this runs both buttons on open this just syncs the code as it flip flops visibility
    
    'Call CirculatoryProbs_Click
    
    
    'End Sub
    
    Private Sub CirAss_Click()
    'toggles visibility of text boxes on button press
    
    If Me.CirAss = True Then CirRiskRating.Visible = True
                            CirPar.Visible = True
                            CirRiskRed.Visible = True
                            CirAction.Visible = True
                            
    If Me.CirAss = False Then
                        
                            CirRiskRating.Visible = False
                            CirPar.Visible = False
                            CirRiskRed.Visible = False
                            CirAction.Visible = False
                           
    End If
    
    End Sub
                            
    Private Sub CirculatoryProbs_Click()
    
    'toggles visibility of text boxes on button press
    
    If Me.CirculatoryProbs = True Then CirDetails.Visible = True
                                     CirDetailstxt.Visible = True
                                     CirLevel.Visible = True
                                     CirAss.Visible = True
                                     Call CirAss_Click
    If Me.CirculatoryProbs = False Then
                                      CirDetails.Visible = False
                                      CirDetailstxt.Visible = False
                                      CirLevel.Visible = False
                                      CirAss.Visible = False
                                      CirRiskRating.Visible = False
                                      CirPar.Visible = False
                                      CirRiskRed.Visible = False
                                      CirAction.Visible = False
                    
    'last 4 false commands clear up the CirAss toggle as if set to true and you toggle the BrethProbs to false they will get left on screen as the BrAss was not toggled to clean them up
    
    End If
    
    
    End Sub
    Last edited by Dazz45; Mar 4th, 2021 at 12:26 PM.

  2. #2

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2021
    Posts
    2

    Re: Spacing problem with Access Form

    Thanks jdc2000, I'll check those links out

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width