Solved

Dynamically calculated field in Form - newbie question

Posted on 2002-03-14
4
152 Views
Last Modified: 2012-08-13
I'm very new at databases and Access, so please be kind...
I have two tables, A and B (in a one to many relationship). I'm trying to create a form for entering data into table A, such that as fields in the record are filled in, an unbound text field will dynamically assemble and display information taken from table B.

If I just enter an expression into the text field's control source property, it doesn't seem to be able to work outside of table A.

Do I need to create a query to mediate between the form and table A and B?, and to create the text for the display field? And if so, will/can the text display field update dynamically as the data entry fields are filled in?

Do I need to learn VBA to do what I am looking for?

Any help would be very much appreciated!
0
Comment
Question by:PatDunlavey
  • 2
4 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 100 total points
ID: 6865860
Pat,

  You need to make a query that joins the two tables, then base your form on that query rather then table a.

  By doing that, you get "row fix-up" automatically.  In other words you'll see all the b table data update when ever you change the a record.

Jim.
0
 
LVL 54

Expert Comment

by:nico5038
ID: 6865973
Hi Pat,

Normally a one to many relationship is used by adding a subform on a mainform.
The mainform is based on the main table and the subform (based on the dependent table) is linked by it's "mainkey-part" to the mainform.
Just using the access wizard, that starts automatically when you place a subform from the toolbox at the left, will guide you through all steps.

Thus only related rows will be displayed in the subform.

Basing one form on a "JOIN" query has the danger of getting a "read-only" situation, not enabling changes to the fields.

What do you want to display in that text field and what do you want to display when you have multiple "B" rows to one "A" row?

Nic;o)
0
 
LVL 54

Expert Comment

by:nico5038
ID: 7055027
for PatDunlavey

No comment has been added for the last two months.
So it's time to clean up this TA.
I will leave a recommendation in Community Support that this question is:
 - Answered by: JDettman (100) nico5038 (100)
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 7070319
Force accepted

** Mindphaser - Community Support Moderator **

Nico, there will be a separate question with points for your help.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now