Re: Creating a New Record for Another Form
- From: John Vinson <jvinson@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 08 May 2006 18:51:17 -0600
On Mon, 8 May 2006 16:48:02 -0700, Ken Mitchell
<Kenwd0elq(NOSPAM)@gmail.com> wrote:
Hi, folks. I'm certain that this has been covered many times, but I can't
find it.
I need to add a new record to a linked form, and then use the new record.
Using the Northwinds database as an example, I'm in the Order form. I need
to add a new order, for a new client.
In the Order form, the client is a combo box;
Ummm...
No. You don't.
Forms don't contain data, any more than my office window "contains"
the Owyhee Mountain range.
And the client is not a combo box. The client field contains data,
probably a numeric ClientID; the Form *displays* that value using a
Combo Box as a tool.
Don't mix levels!
you can't type a new entry
there. So I added a command button to create a new record in the Customers
form. So far, so good. But when I add the new Customer and come back to the
Orders form, the new customer isn't visible; apparently, the combo box list
was generated before the new Customer was added, and I have to close (or
requery) the Orders form before I can use the new Customer.
Is there a way to automate that "requery" and drop that new Customer right
into the Orders form? Thanks.
The simplest way is to use the NotInList event of the Combo Box; see
http://www.mvps.org/access and search for "notinlist". Failing that,
you can requery the combo box itself (without requerying the entire
Form). E.g.
Forms![Your Form Name]![Your Combo Name].Requery
John W. Vinson[MVP]
.
- Prev by Date: Re: Changing read/write properties
- Next by Date: Re: Albert Kallal's word merge
- Previous by thread: Borland Database Engine (BDE) Download?
- Next by thread: Re: DoCmd.Rename
- Index(es):
Relevant Pages
|