-
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.
-
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
-
Re: Two Questions
Problem 2, try showing forms 2 and 3 modally, eg. form2.Show vbmodal
-
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"
-
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.