Results 1 to 4 of 4
  1. #1
    Phoenixenv is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2016
    Location
    Perth, WA
    Posts
    8

    Can I append data to different fields depending on the data within anoth field


    Hi guys, i want to know whether it is possible with an append query to add data to different fields depending on the data in a separate field.

    We capture biological (species and environmental site date) electronically (iphone, ipad, android devices).

    One of the questions our electronic data forms asks is which trip number is this: T1, T2....because we often revisit sites periodically.

    Therefore we have multiple date fields ([DATE1], [DATE2]...) for a site.

    I connect the device data capture software directly to an access table, from which i then select and format data using a select query, then run an append query to add that data to the respective tables.

    So i want to append the date field coming from the device to the date field corresponding to the trip#, e.g. [Trip1] = [DATE], [Trip2] = [DATE2] etc.

    The only other way round this would be to have multiple Date fields within the device forms - not ideal.

    So can i use an IIF statement so that the 'append to' field in the destination table is chosen, based on the data in the [TRIP] field, e.g. IIF([TRIP]="T1", [DATE], IIF([TRIP]="T2", [DATE2], etc

    Is this possible?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    run 2 queries
    qaApd1 to add all records if TRIP = T1
    qaApd2 to add all records if TRIP = T2

  3. #3
    NoellaG's Avatar
    NoellaG is offline VIP
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,180
    Hi, it's not a good idea to have several fields in a table for the same data. I advise to redesign and normalize your database (http://databases.about.com/od/specif...malization.htm) . Once achieved normal form, appending data will be much easier.

  4. #4
    Phoenixenv is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2016
    Location
    Perth, WA
    Posts
    8

    So you are suggesting i break my queries down in parts based on my Trip numbers.

    Quote Originally Posted by ranman256 View Post
    run 2 queries
    qaApd1 to add all records if TRIP = T1
    qaApd2 to add all records if TRIP = T2


    So you are suggesting i limit the select query using the criteria "T1", then append any results to the field [DATE] in the desired table.

    Then effectively run the identical query, but using the criteria "T2", with a subsequent append query, pushing the T2 dates to the [DATE2] field.

    That will indeed work. Thanks.

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

Similar Threads

  1. Append data in a field
    By Voodeux2014 in forum Access
    Replies: 3
    Last Post: 02-10-2015, 04:45 PM
  2. Replies: 7
    Last Post: 03-03-2014, 03:33 AM
  3. Replies: 2
    Last Post: 01-06-2014, 04:22 PM
  4. Display table data depending on selected data
    By swavemeisterg in forum Forms
    Replies: 7
    Last Post: 07-30-2013, 03:43 PM
  5. Replies: 10
    Last Post: 10-11-2012, 01:19 PM

Tags for this Thread

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