Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem accessing control in another form


hello,

I have 2 forms one for basic stock item details and the other is the vb
calender.

When clicking the calender i would like it to populate my combobox
"date1.text".

when i am in my stock item form and i'm editing code i can press
ctrl+spacebar and it will give me a list of valid objects (including my
date1 box) but when i am editing the calender code all the boxes from my
other form aren't there.

Ultimately, when running the calender with "date1.text" in the code,
there are errors.

I am sure this is a schoolboy error and would appreciate some
education!!

thanks in advance for your help

John


--
johncassell
------------------------------------------------------------------------
johncassell's Profile: http://www.excelforum.com/member.php...o&userid=25016
View this thread: http://www.excelforum.com/showthread...hreadid=391689

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Problem accessing control in another form

Hi John,

Do you have a reason for not putting the Calendar control in the same form
as the ComboBox?

Assuming that you do, in the Userform2's Calendar click event, add :

UserForm1.Date1.Value = Me.Calendar1.Value


---
Regards,
Norman



"johncassell"
wrote in message
...

hello,

I have 2 forms one for basic stock item details and the other is the vb
calender.

When clicking the calender i would like it to populate my combobox
"date1.text".

when i am in my stock item form and i'm editing code i can press
ctrl+spacebar and it will give me a list of valid objects (including my
date1 box) but when i am editing the calender code all the boxes from my
other form aren't there.

Ultimately, when running the calender with "date1.text" in the code,
there are errors.

I am sure this is a schoolboy error and would appreciate some
education!!

thanks in advance for your help

John


--
johncassell
------------------------------------------------------------------------
johncassell's Profile:
http://www.excelforum.com/member.php...o&userid=25016
View this thread: http://www.excelforum.com/showthread...hreadid=391689



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem accessing control in another form


Thanks for the reply Norman, I havent tried that code yet but sure it
will work. I have a combobox which hopefully will call the calender
when the drop-down button is clicked, I assumed that the calender had
to be a separate form. Am i right in thinking this?

Thanks again for the reply


--
johncassell
------------------------------------------------------------------------
johncassell's Profile: http://www.excelforum.com/member.php...o&userid=25016
View this thread: http://www.excelforum.com/showthread...hreadid=391689

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Problem accessing control in another form

Hi John,

I assumed that the calender had
to be a separate form. Am i right in thinking this?


No. Given your description, I would only use a single form.

If you use a single form, the code line becomes:

Me.Date1.Value = Me.Calendar1.Value

---
Regards,
Norman


"johncassell"
wrote in message
...

Thanks for the reply Norman, I havent tried that code yet but sure it
will work. I have a combobox which hopefully will call the calender
when the drop-down button is clicked, I assumed that the calender had
to be a separate form. Am i right in thinking this?

Thanks again for the reply


--
johncassell
------------------------------------------------------------------------
johncassell's Profile:
http://www.excelforum.com/member.php...o&userid=25016
View this thread: http://www.excelforum.com/showthread...hreadid=391689



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem accessing control in another form


Yes that worked Norman... cheers , however I have a small problem. Afte
the calender has put the date in my date box and i press enter, th
calender pops up again, it also pops up if i use the mouse to move t
the next box.

Can you help with this please??

Thanks again for replyin

--
johncassel
-----------------------------------------------------------------------
johncassell's Profile: http://www.excelforum.com/member.php...fo&userid=2501
View this thread: http://www.excelforum.com/showthread.php?threadid=39168



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Problem accessing control in another form

Hi John,

Post the userrform code.


---
Regards,
Norman



"johncassell"
wrote in message
...

Yes that worked Norman... cheers , however I have a small problem. After
the calender has put the date in my date box and i press enter, the
calender pops up again, it also pops up if i use the mouse to move to
the next box.

Can you help with this please??

Thanks again for replying


--
johncassell
------------------------------------------------------------------------
johncassell's Profile:
http://www.excelforum.com/member.php...o&userid=25016
View this thread: http://www.excelforum.com/showthread...hreadid=391689



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
2007 Form Control/ActiveX Control font difference Nikko963 Excel Discussion (Misc queries) 0 April 15th 09 04:21 PM
Tool Tip Text for Form control/ Active-X control Freddie[_2_] Excel Programming 0 October 19th 04 04:14 AM
Set Focus Problem for textbox control on multipage control ExcelDeveloperSPR Excel Programming 1 July 16th 04 08:54 PM
Accessing the values of form controls on worksheets in Excel 2000 robbinma Excel Programming 2 August 28th 03 08:35 AM
Accessing ActiveX Controls using VBA - can't use Control.Name to access. Rob Bovey Excel Programming 2 July 30th 03 09:11 AM


All times are GMT +1. The time now is 05:40 PM.

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

About Us

"It's about Microsoft Excel"