Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2010
    Posts
    5

    Calendar Birthday Question

    So I have a table of people's birthdays, along with a calendar and a text box in a form. I want to click a date on the calendar, such that the date only displays in the text box if it matches one of the person's birthdays.



    I tried coding something like this:

    If me.calendar0.value = 1/1/2010 then
    text0 = me.calendar0.value
    else if
    text0 = ""

    *apologize if this should be under programming instead*

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    so what happens with your current setup?

  3. #3
    Join Date
    Oct 2010
    Posts
    5
    what happens now is that is just keeps displaying the values of whatever i click. i refreshed, saved, exited and reopened the form, still the same.

    and then if i try to tweak it, it won't display the value at all.

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by kirklandwater123 View Post
    what happens now is that is just keeps displaying the values of whatever i click. i refreshed, saved, exited and reopened the form, still the same.

    and then if i try to tweak it, it won't display the value at all.
    well if you've already got it to display the value that you click on, that's all the work. now, just add a DCOUNT() function after the part of the code that captures the value:


    Code:
    'code that captures the calendar date
    
    if dcount("birthdayfield", "table", "[birthdayfield] = #" & valuefromcalendar & "#") > 0 then
       'fill the box!  woohoo, it's someone's bday today!
    else
       'don't do anything
    end if

  5. #5
    Join Date
    May 2010
    Posts
    339
    As Adam pointed out you need a "birthdayfield" to compair against your me.calendar0.value. Then you can say if me.calendar0.value = "birthdayfield" then "birthdayfield" = text0 or at least start to sort it out.

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

Similar Threads

  1. Calendar example
    By pkstormy in forum Code Repository
    Replies: 1
    Last Post: 02-28-2011, 04:09 AM
  2. Calendar question in access 2007
    By DPG in forum Database Design
    Replies: 6
    Last Post: 10-06-2010, 11:22 AM
  3. Help with Calendar
    By alanl in forum Access
    Replies: 1
    Last Post: 03-15-2010, 08:16 AM
  4. calendar controls
    By kganomega in forum Access
    Replies: 0
    Last Post: 12-16-2009, 12:34 PM
  5. Calendar Mystery
    By BankWalker in forum Forms
    Replies: 0
    Last Post: 02-16-2006, 01:29 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