Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

setting browse record when form opens

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    setting browse record when form opens

    I have a form that contains a browse based on a child table (contacts).

    Set structure

    Card 1-1 Company
    Company 1-many contacts

    I have set the on row dbl click to open another form called contactlog.

    logentry set structure

    contacts 1-many logentry

    The logentry form has two browses. Browse 1 which shows contact name and browse 2 which shows log entry details (description, date etc.)

    When I open the contact log from the card form I would like browse 1 to default to the the current child record (contact name) from the card form.

    Is there any way of doing this using action scripting?

    #2
    Re: setting browse record when form opens

    You can specify the records that are visible in the called form.
    There can be only one.

    Comment


      #3
      Re: setting browse record when form opens

      Thanks Stan.

      Is there a way of achieving this without filtering as I would like the other names to be displayed as well if possible? I have been looking through the help and I think what I am try to do is set the record pointer for the browse. Just not sure how to do it.

      I have been experimenting with the goto record key by comparing to a variable but haven't got it to work yet.
      The script I tried is

      Get field values into variables (VcSurname)
      open form (log) as model
      Goto record key (another form log - specify a variable - VcSurname)

      The script is located in the on dbl clk of the browse in the card form.

      Comment


        #4
        Re: setting browse record when form opens

        Originally posted by gmeredith17 View Post
        haven't got it to work yet.
        that's a little vague for me. Do you get an error? Does the called form open but not show the correct record?

        A sample database would be helpful.
        There can be only one.

        Comment


          #5
          Re: setting browse record when form opens

          Sorry Stan. I'll try and explain it a little better.

          What I want is all the records in the browse to be displayed but the row selected to be the one matching the name in the card form.

          Example

          In card form select contact name 'anybody' in browse and double click.

          On double click - log form opens and the browse displays all contacts but the selected row is on 'anybody'.

          The method you gave filters the results in the browse for the selected item so all the records are not displayed. Resulting in only 'anybody' being in the browse.

          I hope this explains what I am try to do.

          When I tried the 'goto record key' nothing really happens. The form opens with all records displayed but the record selected is the first in the browse rather than the one matching the variable.

          I will try and attach sample DB later as I need to remove some of the data.

          Thanks for your support.

          Geoff

          Comment


            #6
            Re: setting browse record when form opens

            I hate it when a thread ends with no solution. Has anybody been able to figure out how to move the browse record pointer? I looked for a fetch_goto() method for the browse object but couldn't find one. Is there a way to still do this?
            Robin

            Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

            Comment


              #7
              Re: setting browse record when form opens

              I am trying to make a timecard type form for entering the hours for the current pay period. I want to see all the timecards that exist regardless of which employee record is current. But I want the pointer on the matching record in the browse as the parent is fetched. The set is using a LINK = X field to display all the browse records for the EE_HOURS table. EE_HOURS then links to EMPLOYEE1 on FILENO to get a 1:1 link.

              EMPLOYEE
              ==>EE_HOURS
              .....-->EMPLOYEE1

              I am scripting the navigation buttons and so far the NEXT button has this:

              Code:
              IF parent.mode_get() <> "VIEW" THEN
               PARENT.commit()
              END IF
              PARENT.fetch_next()
              play_sound("C:\WINDOWS\MEDIA\DING.WAV")
              'Goto record with specified key value in current form at parent level.
              DIM GLOBAL get_fileno as C
              DIM tbl as P
              tbl = table.open("ee_hours")
              get_fileno = fileno.value
              tbl.index_primary_put("Fileno")
              tbl.fetch_find(get_fileno)
              rec = tbl.recno()
              tbl.close()
              IF rec < 0 THEN
               END
              END IF
              DIM chld as P
              chld = topparent:browse1.table_get()
              chld.fetch_goto(rec)
              ui_freeze(.t.)
              'parentform.resynch()
              browse1.resynch()
              ui_freeze(.f.)
              ''****
              ''**** End
              The ui_freeze() is not stopping the scrolling in the browse except the first time the script is run. Other than that it does move the record pointer in the browse to the correct record which is now at the top of the list.

              The problem is this is incredibly slow as the primary table is already filtered to only show current records.
              Last edited by MoGrace; 04-18-2007, 04:44 PM.
              Robin

              Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

              Comment


                #8
                Re: setting browse record when form opens

                Robin,

                Maybe you should post your problem as a separate thread. While similar, your problem differs from Geoff's. I think Geoff needs to post a sample database and that's what Stan requested. When he does that I'm sure someone will be able to provide prompt assistance.

                Bob Arbuthnot

                Comment


                  #9
                  Re: setting browse record when form opens

                  Sorry I didn't get back to this thread but I got caught up with things at work.

                  I decided to go with Stan's first suggestion of filtering. Although this wasn't what I thought I wanted when I sat back and looked at the task I was trying to achieve it was a better solution. It is so easy to get caught up with an initial idea and trying to get it to work and forgetting the task at hand and alternative solutions.

                  I guess it is all part of the learning process.

                  Comment


                    #10
                    Re: setting browse record when form opens

                    Frankly I don't know how anyone can help solve this because I don't believe the structure of his database is decipherable from the information that has been provided.

                    There seemes to be two sets and at least 4 tables (??? others):
                    1. Card--Company==Contacts.
                    Form (unknown name) has Browse displaying Contact table on form of this set with a dblclick event that opens a FORM named 'Contactlog' . We do not know what table/set the Form 'ContactLog" is based upon. .

                    2. Company==Logentry
                    The logentry form has two browses. Browse 1 which shows contact name and browse 2 which shows log entry details (description, date etc.)
                    When I open the contact log from the card form I would like browse 1 to default to the the current child record (contact name) from the card form.
                    To this point, the only Browse1 that is described is in the LogEntry Form which views the Contact table. We have no facts about what table(s) are part of the Contactlog Form or what the Browse1 in that Form addresses. Or whether the tables for the Contactlog Form are bound by set rules or 'connected' by common unique field values. Are the LogEntry Form and the 'ContactLog" actually the same Form?
                    with a dblclick event that opens a FORM named contactlog.
                    On double click - log form opens and the browse displays

                    So, personally I don't have the structure in my mind set in order to give a good answer.
                    Mike W
                    __________________________
                    "I rebel in at least small things to express to the world that I have not completely surrendered"

                    Comment


                      #11
                      Re: setting browse record when form opens

                      Mike,

                      Thank you for your interest but as I stated above I went with Stan's suggestion and I'm a little puzzled why you have continued the thread regarding my initial requirement. If it is to chastise me for being new to database design and not providing enough information then consider it done.

                      I would be interested to see if anyone can help Robin with his problem and look forward to seeing your positive input.

                      Regards

                      Geoff

                      Comment


                        #12
                        Re: setting browse record when form opens

                        Originally posted by gmeredith17 View Post
                        Mike,
                        .... I'm a little puzzled why you have continued the thread regarding my initial requirement.
                        Although this wasn't what I thought I wanted
                        You had something in mind that you wanted, it is very likely achievable, but not without clarifications.
                        If it is to chastise me for being new to database design and not providing enough information then consider it done.
                        Goeff, I have no idea what your experience is.

                        Message board readers must construct circumstances from the words they read. What might be believed by the writer as clear and what is deciphered by others is often two different things. The threads are filled with misdirections and wasted time because folks try to take what is read, insert assumptions into what is believed is being written, and the time and energy becomes misdirected. It is encumbent upon the individual seeking help to present information so it can be well deciphered by those trying to help. And not confusing information. And feedback should at the very least be accepted.

                        You did not answer my question of whether you were using two different names to describe the same form.
                        with a dblclick event that opens a FORM named contactlog.
                        On double click - log form opens and the browse displays
                        Missing information compounded by confusing information makes it pretty tough.
                        Mike W
                        __________________________
                        "I rebel in at least small things to express to the world that I have not completely surrendered"

                        Comment

                        Working...
                        X