Re: Entering data in one form while updates 2 or more tables



On Sun, 24 Jun 2007 23:48:03 -0700, qvqv <qvqv@xxxxxxxxxxxxxxxxxxxxxxxxx>
wrote:

Hi, there

I constructed a form! [Purchase] based on a query. The form is based on one
query, which was built from two queries and one table. In this form, by
entering data and saving record, I am able to update the form's underlying
tables and queries upon which the form was built.

However, there're a few fields entered that I'd like to also undate another
table, e.g. [Stock], which is not the underlying table of this form. I am
wondering how I am able to do that.

I suppose maybe some code building or macro is needed to make this
possible? I am totally stuck here, any help or guidance is highly
appreciated.

Many thanks.
qvqv

Well, you can certainly use VBA code in the form's AfterUpdate event to open a
Recordset based on the other table and update it. You have not posted anywhere
near enough information for anyone to write sample code, of course!

HOWEVER... the assertion in your other message that you would otherwise be
entering the same data twice raises some big red flags. The whole POINT of a
relational database architecture is that you should store data once, and once
only; the additional point that the other table is unrelated to this one
strongly suggests a problem with the design!

What are these tables?
What real-life entities (things, persons, events) do they represent?
What needs to be updated in [Stock], and why?

John W. Vinson [MVP]
.



Relevant Pages

  • Re: Cant update table data from form
    ... > tables (the form is built on tables, not queries). ... to more than one newsgroup, ... If the record source of the form is a table (not a multi-table query) ...
    (microsoft.public.access.forms)
  • Re: How do I add a record?
    ... eslinc wrote: ... I just built the form using ... but not all queries allow updating the data. ... are using such a query that would explain why you couldn't make changes. ...
    (microsoft.public.access.forms)
  • Re: command line vs gui
    ... I've been building several web-based database query ... making it possible for the user to specify arbritrary SQL sentences. ... (Actually, in the first project I made, the engine was built so that ... constructing arbritrary queries by SQL. ...
    (comp.os.linux.misc)
  • RE: Troublesome query
    ... > Hi, I have built two different queries, one works, and the second does not ... I am attempting to pull all records from one table, ... The problem I am having is that the second query is not ...
    (microsoft.public.access.queries)
  • Re: Autopopulate
    ... What code do you have that runs in the AfterUpdate event of the combo box? ... I have been successful in having field 2 autopopulate based on entry in ... field 1 combo box based on a query I built. ...
    (microsoft.public.access.forms)

Quantcast