Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Developer Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Recordset for Existing Data in Form
Sami Shamma 
             
14 months ago
Greetings friends

I have the Form in the image below. I would like to run an after-update event on the Shift Combo box that will read the records selected in the detail section (in a record set) and update the "Print All" flag.

Does Access have a method to read what is already selected in the form?

Many Thanks
Sami Shamma OP  @Reply  
             
14 months ago

Adam Schwanz  @Reply  
           
14 months ago
That is filtered down right? By your combo boxes above?

You just need to use the same filter in making a recordset.

For instance, in this kind of search setup.

    If EntityNameSearch <> "" Then
        If Wh <> "" Then Wh = Wh & " " & "AND" & " "
        Wh = Wh & "EntityName LIKE '*" & EntityNameSearch & "*'"
    End If
    If RegionSearch <> "" Then
        If Wh <> "" Then Wh = Wh & " " & "AND" & " "
        Wh = Wh & "Region LIKE '*" & RegionSearch & "*'"
    End If


You can use the same

    If EntityNameSearch <> "" Then
        If Wh <> "" Then Wh = Wh & " " & "AND" & " "
        Wh = Wh & "EntityName LIKE '*" & EntityNameSearch & "*'"
    End If
    If RegionSearch <> "" Then
        If Wh <> "" Then Wh = Wh & " " & "AND" & " "
        Wh = Wh & "Region LIKE '*" & RegionSearch & "*'"
    End If

Currentdb.openrecordset("Select * From Table Where " & Wh)
Adam Schwanz  @Reply  
           
14 months ago
Its actually easier nvm.

    Dim X
    X = Me.RecordSource
    
    Dim rs As Recordset
    Set rs = CurrentDb.OpenRecordset(X, dbOpenDynaset, dbSeeChanges)
    
    While Not rs.EOF
    MsgBox rs!EntityName
    rs.MoveNext
    Wend
    rs.Close
    Set rs = Nothing
Sami Shamma OP  @Reply  
             
14 months ago
Thank you Adam

That is filtered down right? By your combo boxes above? YES

Come to think of it, why not store the WhereStr in the initial search in a TempVars and just use it in the record set.

I was hoping there is a special method that Access has something like:

  Currentdb.openrecordset(SelectedRecord)
Sami Shamma OP  @Reply  
             
14 months ago
Oh, I like that second solution

I will try it now,

Thanks Adam
Sami Shamma OP  @Reply  
             
14 months ago
Adam

It worked like a charm

Thanks

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

Next Unseen

 
New Feature: Comment Live View
 
 

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 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 6/1/2026 5:34:51 PM. PLT: 0s