+ Reply to Thread
Results 1 to 5 of 5

Coding question

  1. #1
    Registered User
    Join Date
    08-10-2005
    Posts
    56

    Coding question

    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
    1. 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.
    2. 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.

  2. #2
    Tom Ogilvy
    Guest

    Re: Coding question

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

    --
    Regards,
    Tom Ogilvy


    "bach" <[email protected]> wrote in message
    news:[email protected]...
    >
    > 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. #3
    Registered User
    Join Date
    08-10-2005
    Posts
    56

    Thanks

    Thanks,

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

  4. #4
    Tom Ogilvy
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    >
    > 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. #5
    Registered User
    Join Date
    08-10-2005
    Posts
    56

    ok

    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 code that works in 2002 not in 2003

    txtdatejoined.value = date

    in 2003 this does not work??

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1