Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying data on form

Status
Not open for further replies.

David Higgs

Programmer
May 6, 2012
392
GB
In my application I would like to display some data on my form in "Text Boxes" (say 10 boxes). As there could be between 1 & 25 entries of 5 fields wide to be displayed I was think along the lines of having a "Previous / Next Command buttons" and displaying 10 entries at a time. It would be a nice option to only have the "command button" showing on the form when there is more than 10 entries.

I was thinking along the lines conditionally copying the data to a two dimensional array. My dealings with arrays is pretty rusty these days!



Regards,
David
 
So what is the question?

There would seem to be a lot of good "learning opportunities' for you in what you describe.

Good Luck,
JRB-Bldr
 
So what is the question?
Initially, just to make sure I'm heading in the right direction. I'm just swatting up on "two dimensional arrays" so will no doubt be back with a few questions!

Regards,
David
 
Why? All this could be done in a grid, even without navbuttons.

If you'd like your own layout of the records simply create a container. Make the grid a 1 column grid and set it currentcontrol to that container and you have a repeated "subform" and can simply scroll through records.

Bye, Olaf.
 
David, don't spend a lot of time thinking about an array - at least, not for this situation. An array is used to hold lists or tabular data internally. It has got nothing to do with the way you display the data on a form.

Nor would I go for a "Previous / Next" button in this case, as that would be a bit of a nuisance from the user's point of view.

I suggest you consider one of the following options:

1. Display each item in its own textbox, with the textboxes laid out on a single form - provided there is enough room for them.

2. If the above would make the form too crowded, use a pageframe. Group the fields into, say, five related groups, and lay out each group on a separate page of the pageframe. Having the user navigate from page to page is easier than having them do a series of command button clicks to reach a given field.

3. Consider using a grid. This would be appropriate if the data is tabular in nature, that is, if it can logically be represented as a set of rows and columns.

4. Consider an edit box. This will allow you to show the data all on the same page, albeit with the user having to scroll vertically to see it all. (The same applies to a grid, but an edit box can be more free-form.)

Which of these you choose depends on the nature of the data and how you think people will want to view it. My personal preference would be the pageframe.

By the way, I'm not saying that you should completely ignore arrays. Rather, an array isn't the solution to this particular problem.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
In my application there are two databases (so far!), one is the "Locomotive Data" and the other is a "history of Depots" that the Locomotive has been allocated to. So far the maximum number of allocations is 25 (not likely to increase much as we are talking in terms of the past. In my research I may find the odd missing data.

I type in a "Locomotive Number" in a search box and display the data on a form similar to this Link

Regards,
David
 
This looks more like a report than a form - especially if the data is read-only, as it appears to be in this case.

A report doesn't have to be something that's printed to paper. You can always simply display it in a Preview window.

Actually, an even better plan might be to display the information in the form of a web page. You would have to know some basic HTML to do that, and perhaps some CSS too. Having created the page, you could either launch the user's default web browser to display it, or use the Microsoft Web Browser control to embed it in a VFP form.

But if that all sounds like to much to learn, think about doing a report instead.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top