Similar Threads:
1.Using import file, Update Fields within a Table
On Apr 14, 9:20 am, AJOLSON < XXXX@XXXXX.COM > wrote:
> I want to import data from a txt file and update fields within a table. More
> specifically what I am looking to do is have the txt file open then evaluate
> each record within a table to match a unique identifier. When the match is
> made I want the "Empty (null)" fields within that file to be updated and
> those fields that are not null to be ignored. Is this at all possible? And
> if so does anyone have the code that will help me execute this.
Yes, it's possible but it's pretty hard for someone to write your code
for you with out a lot more information. You should start by looking
up DoCmd.TransferText, you want to import your text file into a temp
table then create an update query matching your unique identifier in
the temp table to the table you wish to update and setting the
criteria in the fields you wish to update to NOT NULL so it will only
update them if the field is null then run the query.
Hope that helps
Rick
2.Using import file, Update Fields within a Table
I want to import data from a txt file and update fields within a table. More
specifically what I am looking to do is have the txt file open then evaluate
each record within a table to match a unique identifier. When the match is
made I want the 鈥淓mpty (null)鈥?fields within that file to be updated and
those fields that are not null to be ignored. Is this at all possible? And
if so does anyone have the code that will help me execute this.
3.automatically update fields in a table using values within the same table
I have a table that is shown below in ORIGINAL TABLE. It is common for
the VEHICLE # field to have repeating vehicles (ID 3,4,5 & 8,9).
Usually the Vehicle will have SHIPDATE, DATE_RECEIVED, and
DATE_ORDERED for the first entry, after that is could be null (ID 4 &
5). What I would like to do is for a query or VB code to look into the
ORIGINAL TABLE, find the duplicating VEHICLES. Where ever
DATE_RECEIVED or DATE_ORDERED is empty, automatically update it using
DATE_RECEIVED and DATE_ORDERED from the previous entry of the same
vehicle( but SHIPDATE MUST BE THE SAME!!).
ORIGINAL TABLE
ID VEHICLE # SHIPDATE DATE_RECEIVED DATE_ORDERED
1 BF16 5/1/2004 4/30/2004 4/28/2004
2 BF22 5/4/2004 5/1/2004 4/31/2004
3 GT15 5/15/2004 5/10/2004 5/9/2004
4 GT15 5/15/2004
5 GT15 5/15/2004
6 RV66 5/19/2004 5/18/2004 5/17/2004
7 RV68 5/19/2004 5/18/2004 5/17/2004
8 JM40 5/20/2004 5/18/2004 5/16/2004
9 JM40 5/22/2004
10 BX12 5/29/2004 5/25/2004 5/20/2004
RESULTING TABLE
ID VEHICLE # SHIPDATE DATE_RECEIVED DATE_ORDERED
1 BF16 5/1/2004 4/30/2004 4/28/2004
2 BF22 5/4/2004 5/1/2004 4/31/2004
3 GT15 5/15/2004 5/10/2004 5/9/2004
4 GT15 5/15/2004 5/10/2004 5/9/2004
5 GT15 5/15/2004 5/10/2004 5/9/2004
6 RV66 5/19/2004 5/18/2004 5/17/2004
7 RV68 5/19/2004 5/18/2004 5/17/2004
8 JM40 5/20/2004 5/18/2004 5/16/2004
9 JM40 5/22/2004
10 BX12 5/29/2004 5/25/2004 5/20/2004
Here, DATE_RECEIVED & DATE_ORDERED in rows ID 4,5 have been
automatically updated using values from row ID 3. Row ID 9 did not get
updated with using ID 8 because they have different SHIPDATE.
Any help is greatly appreciated. I cannot find a way to solve this at
all.
JIm
4.updating all rows within same field that have same values from separate table
5.Update fields in a table within a Form
I have created a table that contains the following:
DocumentID
Version
DocumentTitle
ObsoleteDoc
ObsoleteDate
ObsoleteReason
BinderA
BinderB
BinderC
etc...BinderABD
I have created an entry form for the information when
originally distributed to the binders
DocumentID
Version
DocumentTitle
BinderA
BinderB
BinderC
etc...BinderABD
Then I created an obsoletion form for the information when
it is no longer a valid procedure.
DocumentID
Version
DocumentTitle
ObsoleteDoc
ObsoleteDate
ObsoleteReason
I originally had toggle buttons for the binders on both
forms for the user to press when the document must go to
the binder.
But now I want to set it up so the user can Obsolete the
Document and it will automatically set the Binder YES/NO
option to NO. When a Document is obsolete it is obsolete
from all binders.
My first thought was:
Private Sub chkobsolete_AfterUpdate()
If Me.chkObsolete Then
Me.togBinderA = 0
Me.togBinderB = 0
Me.togBinderC = 0
Me.togBinderD = 0
....etc
End If
End Sub
But that is not working as we continue to add more binders.
Can someone help me to develop code that would
automatically update the table for those binders to NO
when the chkObsolete is pressed?
I know this isn't correct, bu I was thinking something
like this:
Private Sub chkobsolete_AfterUpdate()
If Me.chkObsolete Then
[MYTable]![BinderA] = 0
[MYTable]![BinderB] = 0
[MYTable]![BinderC] = 0
[MYTable]![BinderD] = 0
....etc
End If
End Sub
Any advise would be great.
Thanks in advance.
6. Updating multiple fields within a single table
7. Counting records within a group of a table and updating the table
8. SQL to update a table from values within same table