PDA

View Full Version : Use calendar to get value from selected date



gsalois
08-13-2010, 04:29 PM
Hi all!

I've got a userform w/4 radio buttons and a calendar form. The user can select one of the 4 buttons which will show one of 4 related charts. The calendar allows the user to select a date and it should return a value based on that date. It's sort of working but the value is NOT what it should be (according to the data in the worksheet it's being pulled from).

I've only started trying to fix the frmAMEX userform and I can't figure out why it's returning a value that appears to be off by a month from the date that was selected on the calendar.

I hope this is just another "d'oh" moment on my part!! Any ideas?
:banghead:

Bob Phillips
08-13-2010, 04:51 PM
The problem is that your tables don't match up. What balance should a date of 8th July return, and what should 13th July return? And if it is what I think, what should 1st Sep return?

gsalois
08-13-2010, 05:21 PM
Thanks for the quick response, James. I attached a scrap file previously just trying to work it out. Basically, if you look at the worksheet chtAMEX, I've got two lists in columns A & B to populate the chart. Eventually I have to figure out how to make that balance in column B match whatever the final balance is for that month.

What I'm trying to do is use the table on that page (Table13) as the source for the value that gets posted in the textbox on the userform. So, if I select the date of July 8th, it should return the value in the "Balance" column of Table13 as of that date.

You make a good point though - if there's no entry with a date of July 8th - it should take the balance entry for July 6th in this case. Possible?

Thanks!

Gene

gsalois
08-13-2010, 06:10 PM
Okay, moved the table on the spreadsheet and got the right number. Once one date is selected, the value in the text box does NOT change no matter what new date is selected. it stays at the value of the first date selected.

Thanks!!!