Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > Help > DevNet >
Back to Access Developer Network    Comments List
ABCD Search Box Upload Images   Link   Email  
JoAnn Brookover      
2 months ago
I am working in the ABCD Database and using the search that Richard set up for it. It works great except when I have a subform that has a subform and it wont search fields on that second subform. I'm looking for someone familiar with the ABCD Search that can fix this for me.
Adam Schwanz             
2 months ago
If you want to send me the database along with what you are trying to do, I'll look at it and give you a price. My email is [email protected]
Shaun Olivera       
2 months ago
Is the VBA set to search the subForms as well as the main form?
Shaun Olivera       
2 months ago
I haven't tested this yet.

DetailsPublic Sub SearchAllForms()

    Dim mainForm As Form
    Dim subForm As Form
    Dim subSubForm As Form
    
    Dim searchTerm As String
    searchTerm = "SearchValue" ' Change this to your search term
    
    ' Adjust "MainFormName" to the name of your main form
    Set mainForm = Forms("MainFormName")
    
    ' Search in Main Form
    ' Assuming "FieldName" is the name of the field you want to search in
    mainForm.Recordset.FindFirst "[FieldName] = '" & searchTerm & "'"
    If mainForm.Recordset.NoMatch Then
        MsgBox "No record found in Main Form"
    Else
        MsgBox "Record found in Main Form"
    End If
    
    ' Adjust "SubFormControlName" to the name of the subform CONTROL on the main form
    Set subForm = mainForm.Controls("SubFormControlName").Form
    
    ' Search in Sub Form
    subForm.Recordset.FindFirst "[FieldName] = '" & searchTerm & "'"
    If subForm.Recordset.NoMatch Then
        MsgBox "No record found in Sub Form"
    Else
        MsgBox "Record found in Sub Form"
    End If
    
    ' Adjust "SubSubFormControlName" to the name of the sub-subform CONTROL on the subform
    Set subSubForm = subForm.Controls("SubSubFormControlName").Form
    
    ' Search in Sub-Sub Form
    subSubForm.Recordset.FindFirst "[FieldName] = '" & searchTerm & "'"
    If subSubForm.Recordset.NoMatch Then
        MsgBox "No record found in Sub-Sub Form"
    Else
        MsgBox "Record found in Sub-Sub Form"
    End If

End Sub

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developer Network.
 

 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 6/14/2024 11:30:16 PM. PLT: 1s