Help with continuous form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dan2kx
    Contributor
    • Oct 2007
    • 365

    Help with continuous form

    Hello to all,

    I need help again,

    im experimenting with continuous forms and im having some difficulty

    i have the recordsource of the form assigned after updating a combo box on the form, by SQL in VBA, this is because i want to pass variables to the query from the combo box and show nothing until then, it seems not to be working though, i checked the results of the query and there are results, what am i doing wrong?

    Im not sure what i can post that will help my question (SQL works on its own)

    any suggestions/further information let me knoe...

    Thanks,

    Dan
  • Dan2kx
    Contributor
    • Oct 2007
    • 365

    #2
    Its always the simplest of things, i was opening the form in ADD mode,
    if only i had realised before i posted...

    Sorry... looks OK now

    Comment

    • Dan2kx
      Contributor
      • Oct 2007
      • 365

      #3
      OK, Proper question, how can i make the Detail section grow with the number of records?
      I presumed "Can Grow" would be for this... apparently not?

      Comment

      • Dan2kx
        Contributor
        • Oct 2007
        • 365

        #4
        Don't mean to throw to many questions up at once... BUT....

        If there is only 1 record in the continuous detail, it doesnt update, similarly if there are two the last one does not update and so on,

        How can i ensure all the relevant records update?

        Comment

        • Dan2kx
          Contributor
          • Oct 2007
          • 365

          #5
          Scratch that last one too, i was trying to goto record rather than save record,

          My question in post #3 still stands though..

          Thanks for being patient with my so far self help thread..

          Dan

          Comment

          • missinglinq
            Recognized Expert Specialist
            • Nov 2006
            • 3533

            #6
            The native CanGrow Property only applies to Reports or when printing a Form.

            Stephan Lebans has a hack for emulating this when displaying forms:



            Linq ;0)>

            Comment

            • Dan2kx
              Contributor
              • Oct 2007
              • 365

              #7
              WOW, thats complicated... is there an easier way!?

              Comment

              • Dan2kx
                Contributor
                • Oct 2007
                • 365

                #8
                Does that just make a txtbox bigger? i cant understand it (sorry)

                Just to clarify, what i want is this...

                I have several records that i have alligned on a single line, i would like each of those to appear consecutively, currently it only shows one with a scroll bar, i would like the form to grow (to a limit obviously) to show each row....

                Pardon my ignorance..

                Dan

                Comment

                • NeoPa
                  Recognized Expert Moderator MVP
                  • Oct 2006
                  • 32656

                  #9
                  Dan,

                  It does make life difficult if you throw multiple questions in the same thread. On the other hand, any question that isn't properly explained is complicated anyway. It sounds like you were in a rush today, but nevertheless, these rules are to benefit you too, as much as they benefit others.

                  I will try to answer you question, but as it seems you allowed haste to send it without being too clear, I may have the wrong end of the stick here, but I'll see what I can do. It seems you have a form where the Detail section is generally not high enough for your records to display clearly. In that case, I would look at it from the other direction completely. Design the section to handle the maximum number of records you want to show, then on Open, or any time you change the Record Source or Filter, or anything which effects the number of records, execute some code to set the height of the section depending on the number of records available.

                  Comment

                  • Dan2kx
                    Contributor
                    • Oct 2007
                    • 365

                    #10
                    Im new to continuous forms, ive never had the need to use them before, but my current scenario, i think depends upon then.

                    i have one row, of 4 textboxes, which relate to a single row of data in a table/query, i presumed that a continuous form would expand that "detail" until it was adequate..., it seems not.

                    are you sayin that if i copy the fields/textboxes on my form several times they will be filled by my data?

                    if so, that leads me on to another question... i dont want to display blank boxes...

                    Thanks for you help NeoPa, i knew you would come....

                    Dan

                    Comment

                    • NeoPa
                      Recognized Expert Moderator MVP
                      • Oct 2006
                      • 32656

                      #11
                      If I understand you correctly Dan, you have 4 controls in your Detail Section; You have set the form to Continuous Forms; and you have multiple records to show. I think my earlier advice was a little wrong (Oooops). The Detail section is repeated for each record, up to the size saved for your form minus any header and/or footer sections. This means that to show more records you will need to save the form at its greatest required height, then, and only if you desire to, set the height to a lesser value in code when there are fewer records than that to display.

                      Ask the question about blank boxes, clearly with decent explanation, in a separate thread ;)

                      Comment

                      • Dan2kx
                        Contributor
                        • Oct 2007
                        • 365

                        #12
                        You are correct Mr NeoPa, however it only ever shows 1 line, is this because it opens with no lines? should i set my recordsource at an earlier event than "form_open" ?

                        ive tried repaint command etc to no avail.

                        i also cant seem to find an option for form height (there is a form width) the detail height just makes my one line a lot bigger (obv)

                        Thanks for the input thus far!

                        Dan

                        Comment

                        • Dan2kx
                          Contributor
                          • Oct 2007
                          • 365

                          #13
                          Problem solved,
                          Code:
                          Me.InsideHeight = 10000
                          Re:Blank boxes, i set the detail's visibility to false at various intervals...

                          Thanks again NeoPa, you always point me in the right direction...

                          Comment

                          • Dan2kx
                            Contributor
                            • Oct 2007
                            • 365

                            #14
                            New question though... on open event using the above code causes the form to grow off the screen, any way to re-center it!?

                            Comment

                            • Dan2kx
                              Contributor
                              • Oct 2007
                              • 365

                              #15
                              I really should try to find things out myself before i bother you avid readers (LOL)
                              Code:
                                  Me.Move Left:=(19200 - Me.WindowWidth) \ 2, Top:=(15360 - Me.WindowHeight) \ 2 '1280x1024
                                  Me.Move Left:=(28800 - Me.WindowWidth) \ 2, Top:=(18000 - Me.WindowHeight) \ 2 '1920x1200
                              Any one got an easier way than that? any easy way to find out the current res in access, to make the code more fluid?

                              I will wait for an answer this time honest! lol

                              Dan

                              Comment

                              Working...