Mervyn Bick <firstname.lastname@example.org>
||Tue, 16 May 2017 10:46:03 +0200
On 2017-05-15 8:51 PM, AGOSTINHO wrote:
> Thanks for the advice.
> I'm so far that I need to go further with my form.
> Now when I run the form I don't see the database information on the GRIP, when I hit the SHOW OTHER TABLE button then I see the databases information.
> I placed a SKIP button on the form but don't know how to get it to work.
Firstly, we need to get some definitions sorted out. It causes
confusion if you use incorrect names for things and this makes it
difficult to provide help.
A DATABASE is a collection of TABLEs. When using .dbf FILEs a DATABASE
NAME can be assigned to a folder either using the BDE Administrator or
code from the dUFLP. Where code and data files are kept in the dBASE
working folder dBASE recognises the folder as the default DATABASE.
country.dbf is a FILE which holds data for the TABLE country.
A grid displays a ROWSET object which contains the data obtained from a
table or a file by a QUERY object. Although not completely correct, as
a rowset need not contain all the data in a table, it is common practice
to say that a grid displays a TABLE.
Your original test form and the example I posted have two queries.
Clicking pushbutton1 should change the display in the grid from one
rowset to the other, Clicking a second time should swap the rowsets back.
Which rowset is not being displayed?
Is any error message displayed?
Ken has given you code to navigate in a rowset in place of SKIP. This
uses the next() method of the form's rowset. Only one rowset can be
assigned to the form's rowset property at a time and in the example it
was set by
this.rowset = this.country1.rowset
You could specify which rowset you want to navigate in your code eg
form.products1.rowset.next() or form.country1.rowset.next() but it would
be better to assign whichever rowset is displayed in the grid to the
form's rowset property,
if form.grid1.datalink = form.country1.rowset
form.grid1.datalink = form.products1.rowset
form.rowset = form.products1.rowset //add this line
form.grid1.datalink = form.country1.rowset
form.rowset = form.country1.rowset //add this line
If you do this the same buttons should navigate whichever rowset is
displayed in the grid.