B
BruceM
I have a standard sort of Purchase Order system, with a main form based on
the PO table and a subform based on a LineItems table. I would like to
prevent users from navigating away from a Purchase Order record before at
least on LineItem has been entered, but if I try to use the main form's
Before Update event it of course fires as soon as the user clicks into the
subform control to add a LineItem record. There are some other times when
Before Update is triggered as well, so my question is whether there is a
reasonable strategy for validating when the user attempts to go to another
record (or close the form). One possibility is that I am using custom
buttons for navigation and to close the form, so perhaps I could call
validation code from those buttons.
In a related question, The PO system is tied in with a Vendor database. A
PO is started by selecting a vendor from a combo box list (VendorID is the
bound field; the vendor name is for display only). The Vendor table and the
PO table are related through VendorID, by the way (typical setup). The rest
of the vendor information (address, phone, etc.) appears in a subform. I
use a subform because the Vendor table has a related Phone table. If the
Phone table is included in the PO form's Record Source query (for display
only; I am only adding and updating data in the PO table, not in the Vendor
or Phone table) the query becomes non-updatable. The simplest solution was
to put all Vendor information, including from the related Phone table, into
a subform which can then be locked to prevent changes to the Vendor
information.
Anyhow, in order to see the rest of the Vendor information (on the subform)
I have been using Me.Refresh in the combo box After Update event (this is
the aforementioned combo box from which I select the Vendor to whom the PO
is being written). Refresh triggers the form's Before Update event (which I
may not be using for data validation anyhow), but I wonder if this is the
best way to get the rest of the Vendor information to appear. Also, there
is a button on the PO form to open the Products form. This is done if it is
discovered that an item is missing from the Product Description combo box on
the Line Items subform.
After entering the item into the Products form I need it to show up in the
Product Description combo box list. How should I go about forcing it to
appear? I can't seem to discover the method (maybe because I'm getting
tired) other than to navigate away from the PO record and back to it.
the PO table and a subform based on a LineItems table. I would like to
prevent users from navigating away from a Purchase Order record before at
least on LineItem has been entered, but if I try to use the main form's
Before Update event it of course fires as soon as the user clicks into the
subform control to add a LineItem record. There are some other times when
Before Update is triggered as well, so my question is whether there is a
reasonable strategy for validating when the user attempts to go to another
record (or close the form). One possibility is that I am using custom
buttons for navigation and to close the form, so perhaps I could call
validation code from those buttons.
In a related question, The PO system is tied in with a Vendor database. A
PO is started by selecting a vendor from a combo box list (VendorID is the
bound field; the vendor name is for display only). The Vendor table and the
PO table are related through VendorID, by the way (typical setup). The rest
of the vendor information (address, phone, etc.) appears in a subform. I
use a subform because the Vendor table has a related Phone table. If the
Phone table is included in the PO form's Record Source query (for display
only; I am only adding and updating data in the PO table, not in the Vendor
or Phone table) the query becomes non-updatable. The simplest solution was
to put all Vendor information, including from the related Phone table, into
a subform which can then be locked to prevent changes to the Vendor
information.
Anyhow, in order to see the rest of the Vendor information (on the subform)
I have been using Me.Refresh in the combo box After Update event (this is
the aforementioned combo box from which I select the Vendor to whom the PO
is being written). Refresh triggers the form's Before Update event (which I
may not be using for data validation anyhow), but I wonder if this is the
best way to get the rest of the Vendor information to appear. Also, there
is a button on the PO form to open the Products form. This is done if it is
discovered that an item is missing from the Product Description combo box on
the Line Items subform.
After entering the item into the Products form I need it to show up in the
Product Description combo box list. How should I go about forcing it to
appear? I can't seem to discover the method (maybe because I'm getting
tired) other than to navigate away from the PO record and back to it.