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

Finding ?

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

    Finding ?

    Hi All,

    I cant seem to get the answered but can someone please tell me how to find a child record using Xbasic and set the record pointer to that record, the field I need to search is store_ID for whatever number the user needs using a variable to get the use info.

    The field is formatted numeric


    -Ray

    #2
    RE: Finding ?

    Ray,

    Perhaps the difficulty is that the question is not well understood. I recommend you take a few minutes a write a very detailed description of what it is you want to do, and the setting in which it will occur.

    -- tom

    Comment


      #3
      RE: Finding ?

      Hi Tom,

      I have tried to do this several times I don�t know how else
      to word it.

      I have a set of tables when I have a form up on the screen
      created for the set I want one of the tables in the set to
      have a record pointer to a particular record based on a value that is in a global variable.

      I don�t know how else to word this this is what I need to do
      the field that Xbasic needs to search to find the record and set the record pointer is formatted number/numeric.

      -Ray

      Comment


        #4
        RE: Finding ?

        Ok,

        The record pointer in any child table linked into the set upon which your form is based is bound to the form. You cannot move it to a record that's not also linked to the current primary table record. i.e. you cannot ask Alpha Five to display a record that's inconsistent with the set design. so, for example, if you had a primary table for Customers, and child table linked 1:N for invoices, you could not use such a form to display Customer Smith's primary record, and Customer Jones' invoices.

        If this isn't what you are trying to do, then describe your problem yet again.

        -- tom

        Comment


          #5
          RE: Finding ?

          Hi Tom,

          If I put a browse for the child table that I want to search
          and move the record pointer to the correct record that works however I want to do this with Xbasic and use a variable to have the user put a number they want then have the Xbasic do the rest.

          Hope I am getting close with explaining this?

          -Ray

          Comment


            #6
            RE: Finding ?

            Ray,

            Check me on this:
            I assume you are looking at a form based on a set with the child records displayed in an embedded browse.

            Here is what I find unclear. Are you trying to find another child record of the *same* parent or do you need to be able to find a child record even if its parent is different from the one currently displayed?

            It can be done. Just need to know where you are trying to go.

            Bill
            Bill Hanigsberg

            Comment


              #7
              RE: Finding ?

              Bill,

              Exactly.

              Figuring out what he wants to do is the key to building the solution. This is not unique to Ray, by the way. For all of us, the key to the solution often lies in understanding the problem.

              Ray, it would help us help you if you would use a specific example. Tell us what the set looks like. Use actual field values. Tell us what the variable looks like. Tell us what you want the xbasic script to do... exactly and completely. Use actual field values.

              -- tom

              Comment


                #8
                RE: Finding ?

                Or zip a copy of the database and attach it. That makes explanations much easier.
                Al Buchholz
                Bookwood Systems, LTD
                Weekly QReportBuilder Webinars Thursday 1 pm CST

                Occam's Razor - KISS
                Normalize till it hurts - De-normalize till it works.
                Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                When we triage a problem it is much easier to read sample systems than to read a mind.
                "Make it as simple as possible, but not simpler."
                Albert Einstein

                http://www.iadn.com/images/media/iadn_member.png

                Comment


                  #9
                  RE: Finding ?

                  Hi William,

                  The child has several record in it I am trying to find a
                  store_ID field value = 12345 or what ever the user puts in a global variable called vgStore_ID.

                  the set works perfectly all I want to do is find a child record in the set the child table is called locations and the field is called store_ID

                  -Ray

                  Comment


                    #10
                    RE: Finding ?

                    ??

                    Ray, re-read Tom's post and use some elementary punctuation to help clarify what it is you are trying to express and I bet someone could help you meet your objectives.

                    Comment


                      #11
                      RE: Finding ?

                      Assuming: The field holding the Store ID in numeric and its field name is Store_Id and the child table is the second table in the set and is the table the browse is based on and that you want to run this from a button on the form......add a button with this code:


                      t = table.current(2)
                      title = "My Consulting Firm"
                      if t.mode_get() "" 0
                      msg = "Please save or cancel changes before initiating search!"
                      code = ui_ok+ui_attention_symbol
                      ui_msg_box(title,msg,code)
                      end
                      end if
                      temp = ui_get_number(Title, "Enter the Store Id to Find")
                      if temp = 0
                      end
                      end if
                      t.fetch_first()
                      while .not. t.fetch_eof()
                      store_temp = t.store_id
                      if temp = store_temp
                      browse1.resynch()
                      browse1.activate()
                      end
                      else
                      t.fetch_next(2)
                      end if
                      end while
                      ui_msg_box(title,"Store not in list",ui_ok+ui_stop_symbol)

                      P.S. Suggest you make store ID a character field.

                      Comment


                        #12
                        RE: Finding ?

                        ray,

                        when you say:

                        'find a child record in the set'

                        you confuse us.

                        The set based form will display any primary table record, and all the currently linked child table records. It will not display all child table records. Do you understand the difference?

                        If the user wants to search for a child table record that is NOT presently linked to the current primary table record, the script would have to do several things, none of which have you mentioned.

                        1) open another instance of the child table
                        2) set the store_id index to control the search sequence
                        3) fetch_find() to find the desired store
                        4) retrieve the set link field value
                        5) close the second instance of the child table
                        6) move the record pointer in the primary table supporting your form to the desired set link field value
                        7) resynch the form

                        This sequence would "find" the desired record in the child table, and then use the current set based form to navigate to the necessary primary table record so that all of its children, including the one you are looking for can be seen through the current form.

                        Does this make sense?

                        Is this what you are really asking?

                        -- tom

                        Comment


                          #13
                          RE: Finding ?

                          Steve

                          While your method will work well, it may be a little slow if the number of child records is large and the store is near the end of the list. Also, ui_get_number() returns a character value.

                          I used a variation of the method mentioned by Tom to find the record number of the correct store and then used fetch_goto() to go to the record. Attached is a sample database that uses that method and your method on the one form for the set. The record number method is on Find 1 and the fetch through the browse is used in Find 2.

                          Jerry

                          Comment


                            #14
                            RE: Finding ?

                            Thanks for the reminder about the ui_get_number returing a character value....I don't think I've ever used this before.

                            Pursuant to Table.external_record_content_get():

                            I'm not sure why it would be faster since it still has to evaluate all records--it's not like it's using an index to find the record, and over a large table, may slow while doing the re-order of records. Notwithstanding, if either method works and Ray's problem is solved....it will save an awful lot of cyber ink.....

                            Comment


                              #15
                              RE: Finding ?

                              Hi All,

                              I want to thank each and every one of you that tried to help
                              with my problem, I have downloaded the table example above and I have taken a look it looks close to what I want however I don�t want the user to see that table I would like all of this to be done in the background after the user selects what to look for.

                              The reason I want to do this is I have to read the information that is in the record corresponding to the
                              Store_ID then set variables with the info.

                              -Ray

                              Comment

                              Working...
                              X