|
-
Oct 7th, 2007, 01:49 PM
#1
Thread Starter
Addicted Member
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.
-
Oct 7th, 2007, 05:45 PM
#2
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
-
Oct 8th, 2007, 01:53 AM
#3
Re: Two Questions
Problem 2, try showing forms 2 and 3 modally, eg. form2.Show vbmodal
-
Oct 24th, 2007, 03:55 PM
#4
Thread Starter
Addicted Member
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"
-
Oct 24th, 2007, 05:31 PM
#5
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|