How do I get a value from a dialog to a field on a subform.

T

texasyankee

I have a form with a subform. After entering order info, the user clicks a
button that brings up a dialog with fields (linked to a table) asking for
info. The information they enter in the dialog is concatenated to form a
tracking number which I want to display in the subform. The subform can
contain many tracking records.
I’ve got the dialog and concatenation working but can’t figure out how to
get the concatenated number from the dialog to the subform.
 
W

Wayne-I-M

Hi

If you are concencating fields to produce a result - would it be possible to
bring the table into the query that the subform is based on and use the query
to concencate the fields for you.

You could then use the calculated result in your subform
 
J

joecosmides

I have a form with a subform.  After entering order info, the user clicks a
button that brings up a dialog with fields (linked to a table) asking for
info. The information they enter in the dialog is concatenated to form a
tracking number which I want to display in the subform.  The subform can
contain many tracking records.
I’ve got the dialog and concatenation working but can’t figure out how to
get the concatenated number from the dialog to the subform.

Is the field in the subform storing the data in a table or is it a
blank field which is only sued to display the data?
 
W

Wayne-I-M

Is the field in the subform storing the data in a table

If it is you need to re-think this - you really don't need to store
concencated (calculated) data
 
J

joecosmides

I'll give you a short example of what I use on one of my forms/
subforms. I have a form called LeadDetailsF and it is the main form. I
have a subform attached to LeadDetailsF which is called QuotationF.
There is a field in QuotationF that calculates the total of 2 fields
in the form and it is called "TotalAmount". I created a blank textbox
and put it on LeadDetailsF and entered in the following into the
Control Source: =QuotationF.Form!TotalAmount which brings the
total amount located on the subform to the main form and shows the
data. Is that what you were looking for?
 
W

Wayne-I-M

There is a field in QuotationF that calculates the total of 2 fields

If these 2 are fields (and not controls) then you can include them in a
query and use that to create a calculated cloumn - the results of this can be
used as the source of a control
 
T

texasyankee

Thanks for responding. I've been gone for a few weeks and am now back at it.
Let me give you a little more information.

The concatenated number is my tracking number and is the primary key in one
of my db tables and is used as the link to other tables.

My DB consists of 6 tables: two joined parent tables, one with three child
tables, and another with one. My main form contains 4 subforms. The
tracking number must display in three of my subforms. The forms are being
used for data entry and for searching.

You mention "a query that the subform is based on". I don't have any
queries at this point. I am using the tables as the record source. Is this
a problem?
 
T

texasyankee

Been away for a while but I'm back at it. Thanks for responding.

The contenated value is being stored in a table when it is created using the
dialog along with information the user entered that created the number. But I
used a table just in case I needed it.

But I need to get this value to my subform when they close the dialog and
then stored in table that my subform uses as a data source when the user
clicks on a Save button. This tracking number is a primary key in one of my
tables and is used as link to other tables.

Hope I haven't confused the issue.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top