Results 1 to 4 of 4
  1. #1
    bbmak is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    15

    How to combine 2 fields into 1 field, and insert into table


    I have a form which has the year and month fields in number from the table, but I want to add a field in the table, so it can insert the year month together which look like this, YYYYMM.
    In the form, I have combine them using control source, =[year] & "" & [month] into 1 field, but how do I insert the unbound combine value into the table? I don't know how to bound them.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Requires code to save calculated data. There is no need to do that, especially in this case. Saving calculated value is usually a bad idea. The combined value can be calculated when needed.

    Since you have Access 2010, you can even use a Calculated type field in the table.
    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
    bbmak is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    15
    for me, I am actually using =[year] & "" & [month] and before update event, I use me.year_month = me.year & me.month
    how do I do that in calculated field?

  4. #4
    bbmak is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    15
    Thx, I got it.
    yes, u r right. The calculated field is better.

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

Similar Threads

  1. Replies: 1
    Last Post: 02-16-2013, 09:11 AM
  2. Replies: 1
    Last Post: 03-06-2012, 07:20 PM
  3. Replies: 3
    Last Post: 12-14-2010, 08:35 AM
  4. Combine one item fields in one field
    By romadm in forum Reports
    Replies: 7
    Last Post: 06-04-2010, 11:09 PM
  5. Replies: 3
    Last Post: 08-02-2009, 03:52 PM

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