Re: Creating a New Record for Another Form



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]
.



Relevant Pages

  • Re: Advice need how to setup table relationship
    ... there are other data structures that may be useful. ... A job for a client can be delivered ... The Customer table has the client's usual address. ... The Orders form is based on Orders Qry - a query that uses both tables. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Advice need how to setup table relationship
    ... I have a client and there are many orders entered for him. ... I don't need to make field assignments as in the ... The Customer table has the client's usual address. ... The Orders form is based on Orders Qry - a query that uses both tables. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Closing Pop Up Form
    ... customer form, and you'll end up back where you were. ... > the requery I am moved to the first record of the orders form. ...
    (microsoft.public.access.formscoding)
  • Re: Advice need how to setup table relationship
    ... I have a client and there are many orders entered for him. ... I don't need to make field assignments as in the ... The Customer table has the client's usual address. ... The Orders form is based on Orders Qry - a query that uses both tables. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Table bloat in Linq-SQL
    ... they are created on client site. ... customers with extended properties using Linq-SQL: ... Those scripts are compiled in customer site and can use extended properties. ...
    (microsoft.public.dotnet.languages.csharp)