Ashfaque
Search Beautiful Girls from your town for night
- Local time
- Today, 16:55
- Joined
- Sep 6, 2004
- Messages
- 897
Hi,
I have a single form (which display patients info) where I am receiving data thru a query called Q_Patient. All fields in form's detail section are bound with query fields.
I have placed some 2-3 unbound text box in form header section named below;
TxtP_Code
TxtPName
etc...
Thru the above unbound text boxes I am receving particular patients as per my requirements. AfterUpdate event of the above unbound text box, I called below function to display particular data. Example if I type patient code and press enter, then particular records are appearing.....
Untill here it is fine.
Once I open the form thousands of records are displaying at first time due to query is record source form. Then if I type patient code then that particular patient will apprear only and load on form will reduce.
What I want is; once the form is open "No records" should be displayed.....
Function SearchP()
Dim strWhere As String
Dim lngLen As Long
Const conJetDate = "\#mm\/dd\/yyyy\#"
If Not IsNull(Me.TxtP_Code) Then
strWhere = strWhere & "([P_Code] Like ""*" & Me.TxtP_Code & "*"") AND "
End If
If Not IsNull(Me.TxtPName) Then
strWhere = strWhere & "([PName] = """ & Me.TxtPName & """) AND "
End If
lngLen = Len(strWhere) - 5
If lngLen <= 0 Then
MsgBox "Nothing."
Else
strWhere = Left$(strWhere, lngLen)
Me.Filter = strWhere
Me.FilterOn = True
End If
End Function
ANY IDEA ?
I have a single form (which display patients info) where I am receiving data thru a query called Q_Patient. All fields in form's detail section are bound with query fields.
I have placed some 2-3 unbound text box in form header section named below;
TxtP_Code
TxtPName
etc...
Thru the above unbound text boxes I am receving particular patients as per my requirements. AfterUpdate event of the above unbound text box, I called below function to display particular data. Example if I type patient code and press enter, then particular records are appearing.....
Untill here it is fine.
Once I open the form thousands of records are displaying at first time due to query is record source form. Then if I type patient code then that particular patient will apprear only and load on form will reduce.
What I want is; once the form is open "No records" should be displayed.....
Function SearchP()
Dim strWhere As String
Dim lngLen As Long
Const conJetDate = "\#mm\/dd\/yyyy\#"
If Not IsNull(Me.TxtP_Code) Then
strWhere = strWhere & "([P_Code] Like ""*" & Me.TxtP_Code & "*"") AND "
End If
If Not IsNull(Me.TxtPName) Then
strWhere = strWhere & "([PName] = """ & Me.TxtPName & """) AND "
End If
lngLen = Len(strWhere) - 5
If lngLen <= 0 Then
MsgBox "Nothing."
Else
strWhere = Left$(strWhere, lngLen)
Me.Filter = strWhere
Me.FilterOn = True
End If
End Function
ANY IDEA ?