Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Coding question


Hi,

I have designed a UserForm which is used to add new members but thi
form would be used to edit and delete them as well. So instead o
creating another identical UserForm, I would like to use this one.

PROBLEM


- I have at the moment code that places todays date in a text bo
automatically but it is editable if a member joined before the dat
they enter it onto the system.

This would need to be disabled, so that when viewing a member
details the date joined would not be overriden.
- The caption on the form would change, and an extra button 'Delete
should appear.


Is it possible to set a variable or something so if variable = add the
this if not then this

--
bac
-----------------------------------------------------------------------
bach's Profile: http://www.excelforum.com/member.php...fo&userid=2613
View this thread: http://www.excelforum.com/showthread.php?threadid=46864

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Coding question

You can execute commands to make these alterations in appearance in the
Initialize event.

--
Regards,
Tom Ogilvy


"bach" wrote in message
...

Hi,

I have designed a UserForm which is used to add new members but this
form would be used to edit and delete them as well. So instead of
creating another identical UserForm, I would like to use this one.

PROBLEMS


- I have at the moment code that places todays date in a text box
automatically but it is editable if a member joined before the date
they enter it onto the system.

This would need to be disabled, so that when viewing a members
details the date joined would not be overriden.
- The caption on the form would change, and an extra button 'Delete'
should appear.


Is it possible to set a variable or something so if variable = add then
this if not then this.


--
bach
------------------------------------------------------------------------
bach's Profile:

http://www.excelforum.com/member.php...o&userid=26134
View this thread: http://www.excelforum.com/showthread...hreadid=468641



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Coding question


Thanks,

put an if statement in the event procedure to deal with the to forms ?


--
bach
------------------------------------------------------------------------
bach's Profile: http://www.excelforum.com/member.php...o&userid=26134
View this thread: http://www.excelforum.com/showthread...hreadid=468641

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Coding question

In a general module, where you will have code to call the form, put in a
public variable at the very top of the module outside any procedure.

Public FormType as Long

Sub Macro1

FormType = 2
Userform5.show
End Sub


in the initialize event for the form

Private Sub Userform_Initialize()
Select Case FormType
Case 1 ' Data entry
'

Case 2 ' Data Editing
Textbox1.Enabled = False

Case 3 ' Date display

End Select
End Sub

as an example.

--
Regards,
Tom Ogilvy

"bach" wrote in message
...

Thanks,

put an if statement in the event procedure to deal with the to forms ?


--
bach
------------------------------------------------------------------------
bach's Profile:

http://www.excelforum.com/member.php...o&userid=26134
View this thread: http://www.excelforum.com/showthread...hreadid=468641



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Coding question


Ok,

I think I got ya will try it out tomrow.

Thanks will reply if i have an issue.

Also can you, explain why this doesnt work. I have a peace of cod
that works in 2002 not in 2003

txtdatejoined.value = date

in 2003 this does not work?

--
bac
-----------------------------------------------------------------------
bach's Profile: http://www.excelforum.com/member.php...fo&userid=2613
View this thread: http://www.excelforum.com/showthread.php?threadid=46864

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
Macro/VB coding question melExcel2007 Excel Discussion (Misc queries) 3 June 4th 10 11:16 PM
visual basic coding question stevie888 Excel Discussion (Misc queries) 0 November 26th 06 10:24 PM
Coding best practice question Mark Stephens Excel Programming 2 May 10th 05 04:48 PM
Automating Autofill Coding Question TrishaB Excel Programming 10 February 7th 05 02:36 PM
coding question No Name Excel Programming 1 September 28th 04 05:26 PM


All times are GMT +1. The time now is 02:03 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"