Question : how search button works

open database- ( i have attached)
switchboard comes up
click S/N SEARCH button
enter 11aa in serial number box
and subform opens up
question:
how is this working?
how does the form initially show up by itself and then subform appears after you enter serial number?

could the way this search is designed be a problem when there are alot of records in database and database is very slow?
thank you
Attachments:
 
example
 

Answer : how search button works

1. the record source of your form have a criteria of

     WHERE (((Twins_Detail.SO_ACT_LOCNOTE)=[Forms]![SN_Lookup]![Text0]))

2. The textbox  Text0 uses the  keydown event

Private Sub Text0_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then    ' << waiting for the Enter key tobe pressed
Me.Requery                   ' do a requery
Call GetCounts
End If

3. The Search button just do a requery of the form, basically the same function when you press the Enter key as in number 2 above

Private Sub Command2_Click()
On Error GoTo Err_Command2_Click

    Me.Requery
    Call GetCounts

Exit_Command2_Click:
    Exit Sub

Err_Command2_Click:
    MsgBox Err.Description
    Resume Exit_Command2_Click
   
End Sub
Random Solutions  
 
programming4us programming4us