Button caption won't update

M

Mark Stephens

I am running a sub that updates a cell in excel and then in turn updates the
caption property of my button to the value in the cell ('AlarmTime', which
is a number representing a date which is appropriately formatted to update
the caption:

Frm_DataEntry.Controls.Item("Btn_CALLBACKDATE").Caption =
Format(dbAlarmTime, "dddd dd mmmm hh:hh")

I have stepped through all the code and it all works exactly as it should
except for the last line (the line above that updates the button).

I replaced the number/date variable woith a string value to check my
referencing of the button... again it updated perfectly, so my only possible
explanation is that the button doesn't like my formatting, but then I use it
elsewhere to update the button and increment the time by one hour (the
subject of my last post) and although there's a bit of a bug in that it
updates a minute too much, it does update, so I am totally confounded as to
what could be the problem! Anyone any ideas?

Thanks in advance, regards, Mark
 
S

Simon Lloyd

Shouldn't this lin
Frm_DataEntry.Controls.Item("Btn_CALLBACKDATE").Ca ptio

Format(dbAlarmTime, "dddd dd mmmm hh:hh")look like thi
Frm_DataEntry.Controls.Item("Btn_CALLBACKDATE").Caption

Format(dbAlarmTime, "dddd dd mmmm hh:*mm*"
I am running a sub that updates a cell in excel and then in turn update
th
caption property of my button to the value in the cell ('AlarmTime'
whic
is a number representing a date which is appropriately formatted t
updat
the caption

Frm_DataEntry.Controls.Item("Btn_CALLBACKDATE").Caption
Format(dbAlarmTime, "dddd dd mmmm hh:hh"

I have stepped through all the code and it all works exactly as i
shoul
except for the last line (the line above that updates the button)

I replaced the number/date variable woith a string value to check m
referencing of the button... again it updated perfectly, so my onl
possibl
explanation is that the button doesn't like my formatting, but then
use i
elsewhere to update the button and increment the time by one hour (th
subject of my last post) and although there's a bit of a bug in that i
updates a minute too much, it does update, so I am totally confounde
as t
what could be the problem! Anyone any ideas

Thanks in advance, regards, Mar

--
Simon Lloy

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com
 
M

Mark Stephens

Hi Simon,

Many, many thanks for that you actually solved two problems in one for me,
as I thought my button caption wasn't updating but it was I just not seeing
it due to not asking to se the minutes (as in mm). Seems so obvious now I
know what it was...that's the good thing about programming, stops you from
getting glib:)

Thanks again, kind regards, Masrk
 
S

Simon Lloyd

I'm glad the we, at The Code Cage could help! :)
Hi Simon,

Many, many thanks for that you actually solved two problems in one for
me,
as I thought my button caption wasn't updating but it was I just not
seeing
it due to not asking to se the minutes (as in mm). Seems so obvious now
I
know what it was...that's the good thing about programming, stops you
from
getting glib:)

Thanks again, kind regards, Masrk


Forums' (http://www.thecodecage.com/forumz/showthread.php?t=66225)


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top