Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / April 2006

Tip: Looking for answers? Try searching our database.

Find Record VBA code Help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ed Bloom - 27 Apr 2006 14:52 GMT
I need help in getting the following pseudo code working.
Thanks in advance.

procedure btnFind_Click()

Ask for Last_Name & First_Name
Search recordset (table)
If Record Count > 1
   list all records in popup box
   allow double-click selection of right person
   populate form (not bound to table) that has the Find Button on it
ElseIf Record Count = 1
   populate form (not bound to table) that has the Find Button on it  
Else
   display MsgBox "No Records Found" with OK
End-if

End procedure

Form is not bound to recordset (table) but has the same fields.  A separate
button will and VBA code will handle Update Recordset functions.
strive4peace - 30 Apr 2006 01:01 GMT
Hi Ed,

rather than poplutating your form with information that is
already stored elsewhere, simply store the ID field of that
record and link to it when you need more information.

create an Autonumber field in the table with the names

ie: PeopleID, autonumber

then, store PeopleID (instead of names) in the related table

on your form, make a combobox:

Name --> PeopleID
ControlSource --> PeopleID
RowSource --> SELECT PeopleID , Lastname & ', ' & Firstname
as [Name_] FROM Tablename ORDER BY Lastname, Firstname
BoundColumn --> 1
ColumnCount --> 2
columnWidths --> 0;2 (etc for however many columns you have
-- the ID column will be hidden)
ListWidth --> 2 (should add up to the sum of the column widths)

PeopleID will be stored in the form RecordSource while
showing you names from another table...

Warm Regards,
Crystal
MVP Microsoft Access

  remote programming and training
  strive4peace2006 at yahoo.com
 *
       Have an awesome day ;)

> I need help in getting the following pseudo code working.
> Thanks in advance.
[quoted text clipped - 17 lines]
> Form is not bound to recordset (table) but has the same fields.  A separate
> button will and VBA code will handle Update Recordset functions.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.