LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Class Modules and Userforms

I'm creating a macro that I want to be more object oriented than procedural.

The macro sends out schedules to employees. The user interacts with a
userform to select the groups to which the schedules should go.

I started by declaring the userform directly from my main sub in the
following fashion.

Dim frmUserForm As FUserformm
Set frmUserForm = New FUserForm

Later, since I wanted to use a class module to encapsulate the information
and functionality I thought I should instead declare the userform in the
class module in a similar fashion as above in order to read values from the
userform into properties in the class module.

i.e. I want to access objSchedules.daynum from the main module where daynum
is determined by a date selected on the userform.

1. Should I declare the userform object in the class module or the main
module?
2. If in the class module, do I also need to declare the class in the
userform module to access properties in the class module? How?
3. If in the main module do I simply set the obj properties using form
properties, i.e.
objSchedules.daynum = frmUserFrom.DayofWeek where DayofWeek has it's own
set of Get and Let procedures and the Let is called from the userforms
OK_Click.

I might have a good cry after this. Thanks for any and all help. I have
read extensively on chip pearsons web site and an article on peltier's
website as well as research on ozgrid and MrExcel. Nothing seems to discuss
interaction between custom class modules and userform(class) modules.
 
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
UserForms VBE and Class Modules... MacGuy Excel Programming 1 December 10th 08 09:21 PM
Class modules: parametrize class object fields Jean-Pierre Bidon Excel Programming 11 August 31st 06 02:49 PM
comboboxes, userforms and class modules natanz[_2_] Excel Programming 3 November 29th 05 02:59 PM
Basic question - modules and class modules - what's the difference? Mark Stephens[_3_] Excel Programming 9 May 8th 05 11:48 AM
Delete Modules and Userforms Peter Pantus Excel Programming 1 September 26th 03 08:17 PM


All times are GMT +1. The time now is 06:26 AM.

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"