Connecting Tech Pros Worldwide Help | Site Map

Updating field, Form to Table

  #1  
Old November 12th, 2005, 09:26 PM
Old Timer
Guest
 
Posts: n/a
I wish to type in a number in my "Code" field, for instance 1060, I
then wish the number 1060 to trigger an event that will fill in the
next field (township field) For instance, 1060 brings up and fills in
name "Spencer Tp". I have 30 townships,2 cities, 6 villages and
identifiers consisting 38 separate code numbers assigned by our county
government to identify each township,city and village.

I ran a "Make Table Query", have created a separate table called
CodeID, using the "tblRegister" table. Used the NoDuplicates in query
properties, have the list sorted properly etc.

I link the two tables together as a 1 to many, the tblRegister being
the "Many" and the CodeID the "One". Using the "Item" column (tp.
assigned numbers)as the indexed foreign key, no index on same field in
tbleRegister, all works well. I open the form, open properties and
select the linked table query as a source.

In the query, I use all fields from the linked tblRegister table,
EXCEPT the two (2)existing in linked table "CodeID", inserting them in
the query list where needed from the linked "CodeID" table, the query
runs well as expected.

Opening the form, and using the linked table query as "source" the
form acts and runs perfect.

I type in Code field "1060", the Township field fills with "Spencer
TP". JUST FINE! EXCEPT!! WHEN I LOOK AT THE TABLE, all information
put in the form is placed in the table as expected WITH THE EXCEPTION
of the "Field I want filled. "TOWNSHIP NAME FIELD",

The field is filled in the form but remains empty in the permanent
"tblRegister" table.

WHAT AM I NOT DOING, OR DOING WRONG? I worked with Paradox DOS in
years past and used a "Lookup" table and all worked real easy. I am
lost in this procedure. Will really appreciate help. At 78 years of
age, maybe I am getting to old. Thank you so much for your time and
effort.
Old Timer:
  #2  
Old November 12th, 2005, 09:26 PM
Bob Quintal
Guest
 
Posts: n/a

re: Updating field, Form to Table


jrjonescl49@adelphia.net (Old Timer) wrote in
news:b6cbea0c.0403070551.1c176ab4@posting.google.c om:
[color=blue]
> WHAT AM I NOT DOING, OR DOING WRONG?[/color]
You are doing nothing wrong, nor failing to do something. You just
need to understand a little bit of RELATIONAL database theory.
Essentially, that says that you keep the data from the lookup table
in the lookup table, and never put it into your main table. In your
case, the lookup is only one field, plus its reference ID. Imagine
if you also had 20 other fields referenced from that same ID. Your
table would get pretty messy.

Now having said that, if you really want to add the "township
name" to the main table, and not just the lookup ID, you need to
set up an event in the form to copy that data to the field.I
suggest that you use the Code afterUpdate event. You will need to
add the township name from the main table to your query, put it
into a hidden textbox,( you don't need to see it twice. Then in the
event I mentioned above you add the procedure that says, me.
<<nameofhiddenField>> = me.<<nameOfVisibleField>>

Bob Q.

[color=blue]
> I wish to type in a number in my "Code" field, for instance
> 1060, I then wish the number 1060 to trigger an event that
> will fill in the next field (township field) For instance,
> 1060 brings up and fills in name "Spencer Tp". I have 30
> townships,2 cities, 6 villages and identifiers consisting 38
> separate code numbers assigned by our county government to
> identify each township,city and village.
>
> I ran a "Make Table Query", have created a separate table
> called CodeID, using the "tblRegister" table. Used the
> NoDuplicates in query properties, have the list sorted
> properly etc.
>
> I link the two tables together as a 1 to many, the tblRegister
> being the "Many" and the CodeID the "One". Using the "Item"
> column (tp. assigned numbers)as the indexed foreign key, no
> index on same field in tbleRegister, all works well. I open
> the form, open properties and select the linked table query as
> a source.
>
> In the query, I use all fields from the linked tblRegister
> table, EXCEPT the two (2)existing in linked table "CodeID",
> inserting them in the query list where needed from the linked
> "CodeID" table, the query runs well as expected.
>
> Opening the form, and using the linked table query as "source"
> the form acts and runs perfect.
>
> I type in Code field "1060", the Township field fills with
> "Spencer TP". JUST FINE! EXCEPT!! WHEN I LOOK AT THE TABLE,
> all information put in the form is placed in the table as
> expected WITH THE EXCEPTION of the "Field I want filled.
> "TOWNSHIP NAME FIELD",
>
> The field is filled in the form but remains empty in the
> permanent "tblRegister" table.
>
> WHAT AM I NOT DOING, OR DOING WRONG? I worked with Paradox
> DOS in years past and used a "Lookup" table and all worked
> real easy. I am lost in this procedure. Will really
> appreciate help. At 78 years of age, maybe I am getting to
> old. Thank you so much for your time and effort.
> Old Timer:
>[/color]

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
I have an expression in the query under my form to autofill the date but it wont write to the underlying table sandraz444@aol.com answers 10 September 22nd, 2006 06:15 PM
Need help binding multiselect listbox to table JNariss@gmail.com answers 1 March 10th, 2006 04:35 AM
Updating field before append query Ray Holtz answers 2 November 13th, 2005 09:43 AM
Carry over data fields from one form to another... Almir answers 2 November 12th, 2005 07:26 PM