Update fields within a Table

MS Office Access

    Next

  • 1. Manipulate Crosstab "ColumnHeadings" Property?
    I'm trying to programmaticially update a crosstab query's "ColumnHeadings" property in VBA that appears in the Query Properties sheet. Any ideas? DBS (David Staas)
  • 2. Formating Data by the use of Queries
    I have two queries that do not have a matching field they also do not have a matching number of records. One Query is a table like below Record1: User Name: Sarah Mertens GroupAccess1:a1 GroupAccess2:e2 GroupAccess3:car GroupAccess4:plane Record 2: User Name: Brandon Teague GroupAccess1:car GroupAccess2:fish The second query is has on one field and looks like below: Record1: Group: a1 Record2: Group:2 Record3: Group:car Etc.... I would like to produce a query or table or report (whichever is easier) that will format the data like.... a1 e2 car plane etc. Sarah Mertens Sarah Mertens Sarah Mertens Sarah Mertens Brandon Teague Can anyone help?
  • 3. College work
    this isa message that will, hopefully, get me a good grade. The news group has some really good information that all can use. Rodney
  • 4. Accessing Access data from other applications w VBA
    I seem to be unable to figure out the syntax to allow me to get at Access data from other programs (in this case Outlook). In this case, I have selected the Access 11 library and Microsoft Active X 2.7 library as references. The table in question is called "client" in a database called "legal files.mdb" Here is what I have so far: ******************************************** Sub GetAccessData() Dim AccessApp As Access.Application Set AccessApp = New Access.Application AccessApp.OpenCurrentDatabase "c:\access\legal files.mdb" Dim myConnection As ADODB.Connection Set myConnection = CurrentProject.Connection Dim myRecordset As New ADODB.Recordset myRecordset.ActiveConnection = myConnection myRecordset.Open "[Client]", , adOpenStatic, adLockOptimistic Dim TotalRecords As String Dim Records As Long Records = myRecordset.RecordCount TotalRecords = Records MsgBox ("Total Records in Client: " + Records) End Sub ********************************************** What am I missing (not that I really understand this or anything). Any help would be appreciated. TIA
  • 5. Comparing 2 databases
    Hello. Does anyone know of a way to compare 2 .mdb files and list the differences? Such as code being different, forms or any differences between 2 files. Any help would be greatly appreciated. Thanks, Mike

Update fields within a Table

Postby Greg » Sat, 16 Dec 2006 15:07:05 GMT

I have a situation I can not solve. Maybe someone can give some advice.

I have an Access 2000 table with aprox. 2600 rows(records). There are about
20 fields/columns in each record.

There has been a major change to data I receive monthly via several CDs. The
best way for me to explain my situation is through an example:

Table A

Rec 1
Field1  Value = 1111111111
Field2  Value = 05/01/2006
Field3  Value = rrr27
Rec 2
Field1 Value = 1111111111
Field2  Value = 06/01/2006
Field3  Value = rrr27
Rec 3
Field1 Value = 1111111111
Field2  Value = 07/01/2006
Field3  Value = rrr27
Rec 4
Field1 Value = 1111111111
Field2  Value = 08/01/2006
Field3  Value = ABC234

Field1 and Field2 are primary keys. Is there any way I can use the value in
Rec 4 Field3 and place in Field3 of Rec1,2,3 ??
The next group of records would have a different field1 value and could have
records 1,2,and 3, because one of the months(Field2) was not sent to me.



Thank You,
Greg



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



Return to MS Office Access

 

Who is online

Users browsing this forum: No registered users and 14 guest