Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default User Form Date Field disappeared!

I have an Excel workbook that I have been using for 6-7 years, initially in
Excel 2003; and more recently in Excel 2007 (where it is saved as an .xlsm
file).

There is a user form to enter data, and one of the pieces of data is a Date. I
could either enter the date directly, or select the different sections (M/D/Y)
and use up/down arrows to change the date. I don't recall how I set this up
initially.

I copy this file back and forth between two different machines -- a Windows XP
machine; and a Windows 7 machine.

Today I opened it on the Windows 7 machine, and the Date field on the user form
was gone!

The code is still there. It merely sets the initial value to today. FirstRun
is a variable that gets set to TRUE by UserForm_Initialize

========================
Private Sub Dt_Enter()
If FirstRun = True Then
Dt.Value = Int(Now())
FirstRun = False
End If
End Sub
======================

Why did the Date field disappear?

How did I set this up in the first place?

Thanks.
--ron
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default User Form Date Field disappeared!

It almost sounds like you are describing the DatePicker control. While I'm
not sure why it went away, I do remember that it is not a native Windows
control; rather, it came with the compiled version of Visual Basic (Common
Controls as I remember) and would be available on your system if you
installed VB5 or VB6 or installed any program that relied on the VB5 or VB6
runtime DLL. Perhaps one of your computers doesn't have the DatePicker
control available and the Reference to it was lost? You could try checking
the References for the project and see if it is available or not and, if
not, try to activate the reference to it.

--
Rick (MVP - Excel)



"Ron Rosenfeld" wrote in message
...
I have an Excel workbook that I have been using for 6-7 years, initially
in
Excel 2003; and more recently in Excel 2007 (where it is saved as an .xlsm
file).

There is a user form to enter data, and one of the pieces of data is a
Date. I
could either enter the date directly, or select the different sections
(M/D/Y)
and use up/down arrows to change the date. I don't recall how I set this
up
initially.

I copy this file back and forth between two different machines -- a
Windows XP
machine; and a Windows 7 machine.

Today I opened it on the Windows 7 machine, and the Date field on the user
form
was gone!

The code is still there. It merely sets the initial value to today.
FirstRun
is a variable that gets set to TRUE by UserForm_Initialize

========================
Private Sub Dt_Enter()
If FirstRun = True Then
Dt.Value = Int(Now())
FirstRun = False
End If
End Sub
======================

Why did the Date field disappear?

How did I set this up in the first place?

Thanks.
--ron


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default User Form Date Field disappeared!

On Sun, 21 Mar 2010 16:07:04 -0400, "Rick Rothstein"
wrote:

It almost sounds like you are describing the DatePicker control. While I'm
not sure why it went away, I do remember that it is not a native Windows
control; rather, it came with the compiled version of Visual Basic (Common
Controls as I remember) and would be available on your system if you
installed VB5 or VB6 or installed any program that relied on the VB5 or VB6
runtime DLL. Perhaps one of your computers doesn't have the DatePicker
control available and the Reference to it was lost? You could try checking
the References for the project and see if it is available or not and, if
not, try to activate the reference to it.

--
Rick (MVP - Excel)


Rick,

After I posted that I realized that it was the DatePicker control. I had
thought that to be the case, but initially could not find it.

And I think you're correct about it being a reference problem, possibly due to
the fact that my XP machine is 32 bit and the W7 machine is 64 bit. I'm
thinking this because when I finally located the reference containing the
DatePicker control on my W7 machine, it has a "64" in the pathname:
C:\Windows\SysWOW64\mscomct2.ocx

I believe that file is in the Windows\System32 folder on an XP machine (at
least it is on the XP Virtual Machine that I have on my W7-64 computer.

Interesting gotcha.

Thanks.
--ron
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default User Form Date Field disappeared!

I believe that file is in the Windows\System32 folder on an XP machine (at
least it is on the XP Virtual Machine that I have on my W7-64 computer.


Really? Do you have to do something to activate it? When I installed Vista
on my computer a few months ago, (I could be wrong about this... old age and
all<g) I am almost positive that I looked to see if I could add the
DatePicker control to a UserForm and couldn't until after I installed my
copy of the compiler version of VB6.

--
Rick (MVP - Excel)

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default User Form Date Field disappeared!

On Mon, 22 Mar 2010 09:49:40 -0400, "Rick Rothstein"
wrote:

I believe that file is in the Windows\System32 folder on an XP machine (at
least it is on the XP Virtual Machine that I have on my W7-64 computer.


Really? Do you have to do something to activate it? When I installed Vista
on my computer a few months ago, (I could be wrong about this... old age and
all<g) I am almost positive that I looked to see if I could add the
DatePicker control to a UserForm and couldn't until after I installed my
copy of the compiler version of VB6.


Well, I definitely did not install VB6.

In W7, the Date/Time picker did not appear initially on the VBA userform
ToolBox. But when I right-clicked on the toolbox, and selected the option to
add more controls, in the drop down list (once I finally found it) there was an
entry for "Microsoft Date and Time Picker Control 6.0(SP4)"

I've never had a Vista machine.
--ron


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default User Form Date Field disappeared!

Which version of Mscomct2.ocx do you have, which contains the DTPicker. If
not 6.1.98.16 see here and install the latest

http://support.microsoft.com/kb/957924

Regards,
Peter T

"Rick Rothstein" wrote in message
...
I believe that file is in the Windows\System32 folder on an XP machine
(at
least it is on the XP Virtual Machine that I have on my W7-64 computer.


Really? Do you have to do something to activate it? When I installed Vista
on my computer a few months ago, (I could be wrong about this... old age
and all<g) I am almost positive that I looked to see if I could add the
DatePicker control to a UserForm and couldn't until after I installed my
copy of the compiler version of VB6.

--
Rick (MVP - Excel)



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default User Form Date Field disappeared!

On Mon, 22 Mar 2010 19:22:20 -0000, "Peter T" <peter_t@discussions wrote:

Which version of Mscomct2.ocx do you have, which contains the DTPicker. If
not 6.1.98.16 see here and install the latest

http://support.microsoft.com/kb/957924

Regards,
Peter T


I have an older version of that file. OTOH, my OS is not listed in the
"applies to" portion of the MSKB article.
--ron
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
user form start field Alberto Ast[_2_] Excel Programming 2 November 17th 09 07:06 AM
Basic user form question - hjow to write to a text field Mark Stephens Excel Programming 1 March 8th 09 02:29 PM
Date field in user form & Loading a user form on opening workbook Balan Excel Programming 1 May 24th 08 03:40 PM
formula behind field on user form Lisa Excel Programming 3 March 5th 08 06:06 PM
user form, field split??? Rominall Excel Programming 1 November 19th 07 03:12 PM


All times are GMT +1. The time now is 02:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"