Results 1 to 5 of 5

Thread: Two Questions

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2006
    Posts
    243

    Two Questions

    Hi all,
    I'm facing two problems.

    1] I've a one form with KEYPREVIEW=TRUE. On the Forms KeyDown Event I've Written this code.

    If KeyCode = 114 Then '--Show Transaction Date [F3 Key Pressed]
    Frame1.Visible = True
    TrDateNew.Value = Format(Date, "dd/mm/yyyy")
    Label15.Caption = UCase(Format(TrDateNew.Value, "dddd"))
    TrDateNew.SetFocus
    End If

    It works fine means when I pressed F3 Key cursor goes to Date. But if Mine cursor is on Grid Control and I Pressed F3 my cursor doesn't go to date control. I've to press TAB then it goes there.

    2] I'm using forms in a form. Means I've a Mainform from there I use my second form (Secondform.show,me). then from Second form I Opens Third form (ThirdForm.show,Me). Problem is this that when I close Third form and then Second form Cursor Doesn't go to First Form. Offcourse in the Unload event of second form I wrote UNLOAD THIRDFORMNAME.

    What would b the problem.???? Please Help.

  2. #2
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,515

    Re: Two Questions

    Problem 1 - Not sure why, but probablely could make it work by working with the key press event of the grid

    Problem 2 - try adding form1.show in the form2 unload event

  3. #3
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: Two Questions

    Problem 2, try showing forms 2 and 3 modally, eg. form2.Show vbmodal

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Aug 2006
    Posts
    243

    Re: Two Questions

    But when I use form3.show vbmodal from form2 which is opened from form1 he shows me an error like "can't show non-modal form when modal form is displayed"

  5. #5
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Two Questions

    Problem 1 - I'm guessing you have code in the grid control's KeyPressed, KeDown or KeyUp events. Put the TrDateNew.SetFocus in them.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

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