Quantcast
Viewing all articles
Browse latest Browse all 21182

Not able to get the textbox focus from one form to another

Friends,

feesentry1:

Code:

Private Sub txtbrno_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = vbKeyF9 Then
    If cmdqry.Enabled = False And cmdedit.Enabled = True And cmdcancel.Enabled = True Then
        strqry = "SELECT brno,stdname " _
        & "FROM stdentry where (isnull(delstat) or delstat='') order by brno"

        Search.Adodc1.RecordSource = strqry
        Search.Adodc1.Refresh
        Search.Show 1
    End If
End If

End Sub

Search Form:

Code:

Private Sub Grid_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    On Error GoTo ErrorHandler:
    If Feesentry1.Visible = True And Feesentry1.cmdedit.Enabled = True Then
        Feesentry1.txtbrno.Text = Trim(Me.Grid.Columns(0).Value)
    End If
    Me.Hide
    Feesentry1.txtbrno.SetFocus
Exit Sub
ErrorHandler:
MsgBox "No Record found"
Me.Hide
Feesentry1.txtbrno.SetFocus
End If

End Sub

From the above code....i am getting the values from search form to my feesentry1 form...but the control is not coming inside the textbox and the feesentry1 form is also not getting the focus... after getting the value from search form to feesentry1 form i have to click on the textbox of the feesentry1 form. then i have to press enter.

how can i solve this issue?

thanks

Viewing all articles
Browse latest Browse all 21182

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>