Results 1 to 3 of 3
  1. #1
    MintChipMadness is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    109

    Dateserial Expression in Text Box using Values From Two Controls


    Hi Everyone,

    I am having an issue putting an expression in a text box on my form. I listed the two controls I am using and the expression below them. I am setting the Control Source as the expression. I did some trouble shooting by putting the text box just equal to the first control and then to just the second one. They show the correct values individually but when I put them in the expression they don't work. I did find out that the part where it goes wrong is at the addition. How I found that is I took out adding of the second control all together and it came out with the correct date. All I am trying to do is add a number to the amount of years and display it. Thank you for your help.


    Control #1 (Text Box): [recordfye] = date
    Control #2 (Combo Box): [catcbo]![column](6) = number

    DateSerial(Year([recordfye])+[catcbo]![column](6),Month([recordfye]),Day([recordfye]))

  2. #2
    MintChipMadness is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    109
    I figured out what my error was. I should have used a period instead of an exclamation point in between the column and control of catcbo. The correct expression is below.

    DateSerial(Year([recordfye])+[catcbo].[column](6),Month([recordfye]),Day([recordfye]))

    The expression below worked as well

    =DateAdd("yyyy",[catcbo].[column](6),[recordfye])

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Thanks for sharing your solution!

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

Similar Threads

  1. Replies: 7
    Last Post: 07-02-2013, 12:02 PM
  2. Replies: 5
    Last Post: 05-22-2012, 08:06 AM
  3. text box expression inserted to table
    By normie in forum Access
    Replies: 3
    Last Post: 03-13-2012, 04:14 PM
  4. setting values of multiple controls
    By desimoreno in forum Forms
    Replies: 9
    Last Post: 12-14-2011, 02:54 PM
  5. Replies: 2
    Last Post: 10-27-2011, 10:28 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