Subject Re: Form menu's
From Mervyn Bick <invalid@invalid.invalid>
Date Mon, 27 Jul 2020 11:07:40 +0200
Newsgroups dbase.getting-started

On 2020-07-27 03:41, Tony Hughes wrote:
> Hi more help ?
>
> Can anyone explain to me why " code one works" , and "code two" will not - I have played with this for 6 hours and can not see the difference - Too simple ??
>
> Code one works perfectly in using coded forms ?, and I want to repeat.

You will always find help here in the newsgroups but I'm afraid you need
to be a bit more specific when you describe problems.  "Doesn't work" is
a bit too general.  You need to tell us what you expect the form to do
for specific actions and what happens (or doesn't happen :-) ) when
those actions occur.  If you get error messages give us the wording
including the line number where the error occurs.  Without this we're
just shooting in the dark.

"Code two" has several things that stand out.

You have a database object and a query object on the form which are
redundant.  They are not made active and they don't get referenced
anywhere in the code.

The ADMINISTRATION1 query is not made active so it's rowset is not
available.  Even if you set the active property true you don't display
anything from the rowset.

With ADMINISTRATION1 inactive changing the values in the spinboxes
should cause an error as the rowset that they want to update doesn't exist.

With ADMINISRTATION1 active, the two spinboxes can change the values in
the DisplayTime and Duration fields but this will always be in the first
record.  You don't explicitly save the change but dBASE would make an
implicit save when the form closes.  Implicit closes have their uses but
they can cause problems and it's not a good idea to rely on them.

The two spinboxes are going to place integer values in the fields. Is
this what you want?

It's not a good idea to have spaces in folder or field names.  They are
permitted but require special handling which can become a PITA.  Rather
use an underscore character _ in place of a space to improve readability.

It is a good idea to avoid hard-coding the path of a data file.  If the
.dbf file is not in the same folder as the form or program rather create
a BDE alias, or a USER BDE alias, and use a database object.

Both forms have pushbuttons which launch other forms and then close.
This means that the user has to reopen the "menu" form before an new
task can be started.  If this is really what you want then so be it but
it's not really the Windows way of doing things.  The dBASE tutorial
will introduce you to the Windows way. :-)

Mervyn.