We help IT Professionals succeed at work.

2 ways to search thru records with combo box

davetough
davetough asked
on
hello,
am attaching a sample database with 2 forms.
open database and open form1-
I have  code in combo box.
   [Dim rs As Recordset
  Set rs = Me.Recordset.Clone
  rs.FindFirst "[ClientID] = " & Me.cboSelectClient.Value
  If Not rs.EOF Then Me.Bookmark = rs.Bookmark]

I realized I can also create with the wizard (form2)-the same type of search.

question: they both use the same query in the row source of the combobox.But I don't understand how form2 can work without the code that form1 has.
Can you explain the differences of the two forms?
thank you
TestA.accdb
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2013

Commented:
Your second form is using an Embedded Macro that does effectively the same thing as the VBA in the After Update event of Form 1.

Here's a screenshot:
Embedded Macro
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2013
Commented:
As an aside, embedded macros are new to Access 2010.

My personal preference is still VBA like you have behind Form1.  I find it easier to develop, better organised, and find the error messages more meaningful.

Author

Commented:
Thank you- ( apoligize for delay - purchasing new computer)

Explore More ContentExplore courses, solutions, and other research materials related to this topic.