Linking Lists across Forms

Working with list controls (such as ListBox and ComboBox controls) isn't always a matter of controlling the Row Source Type and Row Source properties of the control. In some cases, it's just getting the darn control to show what's currently in the underlying table or query. Or worse yet, getting it to accept a value that should be acceptable to the control — but isn't. These types of problems happen a lot when two or more forms are involved in the scenario.

I suppose a typical example would be where a user is trying to type in a new order, perhaps coming in over the phone. Say the user is sitting there looking only at the Orders form shown at the left side of Figure 10-12. To start typing in an order, she can choose an existing customer from the CustID combo box on the Orders form, or she can click New Customer (NewCustBttn) to enter name and address info for a new customer.

The names and e-mail addresses shown in these figures are all fake, so don't bother trying out any of the e-mail addresses to see whether they actually go anywhere.

If your user clicks the New Customer button, the NewCust form (also shown in Figure 10-12) opens at a blank record, ready to type in a new customer's info. Say the user types in the info and clicks the Done - Fill Order button (named DoneBttn). At that point, the NewCust form closes, and the user is returned to the Orders form. That moment in time — when the NewCust form closes and the focus returns to the Orders form — is where most troubles begin. The problem has to do with when a combo box or list box gets its data from an underlying table or query, which (in general) is only once — when the form opens.

CustID

il MOM 2003 Orders

Orders Form

Data: 3/10/2003

Aryi'i/Lrn, M.-t Ldttl. tn.-ru.ytylCl^':i|--:::t'ytri J-urr

Bebop, Stacey ■ [email protected]:orn l'n-:hj, Carlos [email protected]^gtii:CDm

Citrus. Michael michaelcacitrus.com

Costelloj Karen [email protected],com

Creative-Pes igrtg- | [email protected]

NewCustBttn

J MOM 2003 Address Book

New Customer

CustID: I 37

Email f" Phone

CustID

DoneBttn

0 0

Post a comment