table design

  • Thread starter Thread starter Faisal
  • Start date Start date
F

Faisal

There is any way to have a field name should automaticaly liknked with
another table
becuse i want to design a table in there field name should updated
utomaticaly from another table
any tips
regrds
faisal
Riyadh
 
It sounds like a bad idea, there are better (and accepted) ways to accomplish
what you are looking for.

By the fact that you are talking about updating a field in a particular
record based on a change in a field in a particular record means that there
is some relationship that ties those two records together. If this is a
simple "one-to-one" relationship between the records, then you chould combine
them into a single table. If not, then you should link them.

The next step would require knowing more about the structure of your data
and what you are trying to do. But generally speaking, you should just show
the single field with that data wherever you need it (in a query, form or
report) , not have two fields with the same data.
 
On Tue, 4 Dec 2007 02:10:01 -0800, Faisal

No. You need to write an Update query, and run it when the field
value changes, likely in its AfterUpdate event.

You may also need to reexamine your database design. These
interdependencies often are indicative of db design problems.

-Tom.
 
Not automatically, but the following code will allow you to easily change a
field name via code.

Sub Change_Field_Name(Target_Table As String, Old_Field_Name As String,
New_Field_Name As String)
On Error GoTo error_handler
Dim db As Database
Dim tdf As TableDef

Set db = CurrentDb
Set tdf = db.TableDefs(Target_Table)

tdf(Old_Field_Name).Name = New_Field_Name

Set tdf = Nothing
Set db = Nothing
Exit Sub
error_handler:
MsgBox Err.Description

Set tdf = Nothing
Set db = Nothing
End Sub
 
Back
Top