Results 1 to 4 of 4
  1. #1
    murry is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    9

    Is there a simple way to automatically add rows to a table or fields to a query.

    I am using Access 2007. I have an ODBC source feeding data into a table, to which I made a crosstab query that displays the useful data from that source. I need a way to add data(new field), using a form, that is a associated with the lines in the query. I've tried creating another table that uses the sample ID as the primary key, but I need it to automatically create a new row for each query line. Is there a way to do this, or better way to add data to a query. Examples are below. Thanks in advanced.

    The ODBC data looks something like this

    SampleID PeakName Conc
    sample1 THF 50
    sample1 MEOH 10
    sample1 propanol 25
    sample1 butanol 15
    sample2 THF 21
    sample2 MEOH 15
    sample2 propanol 17
    sample2 butanol 23

    I have the querry look like:
    SampleID THF MEOH propanol butanol (I need to be able to add a field here)
    sample1 50 10 25 15
    sample2 21 15 17 23

    linked table I created:

    SampleID LIMS #


    sample1 1234567
    sample2 4567891


    the problem is, for this table I have to manually select each sample ID. I want it to automatically add the sample IDs as new ones are querried.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    You cannot add data to a crosstab query. Need to add records in the source.
    Last edited by June7; 03-26-2012 at 07:07 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    I don't see what you are asking here - the samples are represented by rows in the crosstab query, not columns. Columns in the crosstab represent PeakNames. If you have Peaknames other than the 4 you have shown in the ODBC data, they will show up automatically in the crosstab.

    "I want it to automatically add the sample IDs as new ones are querried."

    What do you want to add the new sample ID's to? And what does it refer to?
    I don't see what you need the separate "linked" table - are the sample numbers not in the ODBC data?

    More details, please!

    John

  4. #4
    murry is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    9
    I need to be able to add additional data that is not part of the ODBC transfer (i.e. "Lims#" from the sample above). I need to have it associcated with the rows I have querried, not the columns in the ODBC data. I was thinking that if a created another table that was linked to the query I could use a form to enter the addtional data. The problem is the new table (the it from above) requires you to add each SampleID row by row from a drop down menu. I am wondering if there is a way to have the rows automatically be created whenever a new row is created in the query. Thanks in advance.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Query to find and COMBINE rows based on 2 fields
    By admessing in forum Queries
    Replies: 2
    Last Post: 12-13-2011, 12:59 PM
  2. Replies: 1
    Last Post: 12-03-2011, 01:26 AM
  3. Add Event To Automatically Run Make Table Query
    By symphony in forum Programming
    Replies: 1
    Last Post: 07-18-2011, 08:11 AM
  4. Replies: 7
    Last Post: 06-14-2011, 10:37 AM
  5. Run Make Table query automatically
    By tuna in forum Queries
    Replies: 5
    Last Post: 05-10-2010, 03:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums