Results 1 to 4 of 4

Thread: what's wrong with this code..

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Posts
    8

    Post

    Private Sub File_Click()

    End Sub

    Private Sub mnuPayment_Click()
    txtPayment.Enabled = Not txtPayment.Enabled
    mnuPayment.Checked = txtPayment.Enabled
    mnuPayment.Checked = False
    mnuPresentValue = True
    mnuFutureValue = True
    End Sub

    Private Sub mnuPresentValue_Click()
    txtPresentValue.Enabled = Not txtPresentValue.Enabled
    mnuPresentValue.Checked = txtPresentValue.Enabled
    mnuPayment.Checked = True
    mnuPresentValue.Checked = False
    mnuFutureValue.Checked = True
    End Sub

    Private Sub mnuFutureValue_Click()
    txtFutureValue.Enabled = Not txtFutureValue.Enabled
    mnuFutureValue.Checked = txtFutureValue.Enabled

    mnuPayment.Checked = True
    mnuFutureValue.Checked = False
    mnuPresentValue.Checked = True

    End Sub

    I am trying to select only one of the menu items which by deselecting other two items...any suggestions w/ the error in the code.


    Thanxs for the help in advance



  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    In each routine you have something like

    mnuPayment.Checked = txtPayment.Enabled
    mnuPayment.Checked = False

    You didn't say what the problem is, but the second line is probably it's cause. If txtPayment is enabled, the first line sets mnuPayment to Checked, and the second line immediately sets it to Unchecked. You probably should remove the second line.

    ------------------
    Marty
    What did the fish say when it hit the concrete wall?
    > > > > > "Dam!"

    [This message has been edited by MartinLiss (edited 02-11-2000).]

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Posts
    8

    Post

    Thanxs marty...but it doesnt seem to work...checking was all screwed up once I got rid of the second line..here is the deal..all I am trying to do is: If payment menu option is selected, it is supposed to have a check mark then shade out other 2 items and disable selecting text box for payment.


    Manoj

  4. #4
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    Post

    txtPayment.Enabled = Not txtPayment.Enabled
    mnuPayment.Checked = txtPayment.Enabled
    mnuPayment.Checked = False
    mnuPresentValue.Checked = True
    mnuFutureValue.Checked = True

    You forgot your .checked

Posting Permissions

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



Click Here to Expand Forum to Full Width