same Form question again.Lin,
Couple of observations.
If you are using a DBLookUpComboBox you may need to add a DBEdit field
associated with the same column as the DBLookUpComboBox
and hide it behind the DBLookUpComboBox.
Another thing. In the speed button it sounds like you are sending EDIT USING
rather than ENTER USING.
EDIT USING would pull up the first row if you do not use a WHERE clause.
If I remember the SalesOrder form correctly you use it in the ENTER USING mode.
When using it this way your data row isn't really there until you
issue a POST or SAVEROW so your eep to check the supplier may not be working
because of that. In that case you should use the PROPERTY
commands.
Also be very sure that your eep is the the ON EXIT
Jan
----- Original Message -----
From: Lin MacDonald
To: RBASE-L Mailing List
Sent: Tuesday, January 22, 2008 5:59 AM
Subject: [RBASE-L] - same Form question again.
Sorry, this one is still eluding me:
Verifying Data Entry.
I'm developing a form that is very similar to the SalesOrder form in RRBYW14.
Once the User chooses a Supplier, the address on record appears. (Not
changeable). Then, they enter the Description of the item being purchased
(only 1 item per form, as opposed to the RRBYW14 example). Once they enter the
field to input the description, I want to check that they haven't left the
Supplier field blank, and if they have, send them back to it. I added an EEP
on Entry into the Description field, but nothing seems to happen. Here's what
I put in:
IF vref# IS NULL THEN
PAUSE 2 USING 'You MUST Select a Supplier!' CAPTION ' New Transaction'
ICON stop
SKIP TO ref#
RETURN
ENDIF
SELECT company INTO vpurchfromcompany INDICATOR ivpurchfromcompany FROM
contacts WHERE ref# = .vref#
RECALC VARIABLES
RETURN
This is a suggestion I was given:
The code should be on exit from the field you are verifying. You can then use
IF vref# IS NULL THEN
PAUSE 2 USING 'You MUST Select a Supplier!' CAPTION ' New Transaction' ICON
stop
SKIP 0 -- that's a zero
RETURN
ENDIF
SELECT company INTO vpurchfromcompany INDICATOR ivpurchfromcompany FROM
contacts WHERE ref# = .vref#
RECALC VARIABLES
RETURN
Still nothing. The field that the User chooses from is a DBLookUpComboBox.
It references another table. From the other table (Contacts) it displays a
Supplier name which uses a PK called REF#. The column REF# does not show; just
the Name. I want the User to either choose a Supplier from the Drop down list,
or utilise the Speed Button next to it to open another form and enter a new
Supplier.
Question 2: when the SpeedButton above is clicked, it calls up a form for
entering a new Supplier. However, the form always appears with the first row
of data in it, instead of a blank form. Same thing happens when I am entering
that form normally.
thanks again,
Lin