Find a record from a listbox

  • Thread starter Thread starter Jorge Novoa
  • Start date Start date
J

Jorge Novoa

Hello!

What I got:
Access XP, an MDB in 2002 format.
I got two forms: I have a form called "Retts", and a listbox called
"lstRetts" in the form "RettList".

What I want:
I want to locate a record and make it the current record from Retts by
double clicking on a row of the listbox in RettList.

What I've done:
I already know how to do it by opening the form and using o the 'open' event
of Retts:
If Me.OpenArgs = "OpenFromList" then
Me.CodRett.SetFocus
DoCmd.FindRecord Forms!RettList.lstRetts, acEntire, ,
acSearchAll, , acCurrent
End If

It works fine!!!, but my problem is when I double click on another item from
the list AND the form Retts is already open. Of course the open event won't
work. So.. how to handle this?

What I need: How to locate, and move to the specified record in the list,
even if the form Retts is already open?
Note: I prefer not to aplly filters, 'cause I'd like to browse the records
once a record is located.

Please help me!

Thanx!
 
Hi Jorge,

Why not use the solution in

ACC2000: Four Ways to Move to a Record from a Combo Box Selection
http://support.microsoft.com/default.aspx?scid=kb;en-us;209537

Just use same solution for Combo box for Listbox control.

I hope this helps! If you have additional questions on this topic, please
respond back to this posting.


Regards,

Eric Butts
Microsoft Access Support
(e-mail address removed)
"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
<http://www.microsoft.com/security/security_bulletins/ms03-026.asp> and/or
to visit Windows Update at <http://windowsupdate.microsoft.com/> to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."

This posting is provided "AS IS" with no warranties, and confers no rights

--------------------
| From: "Jorge Novoa" <[email protected]>
| Subject: Find a record from a listbox
| Date: Wed, 2 Jun 2004 11:54:08 -0500
| Lines: 41
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.access.forms
| NNTP-Posting-Host: ip-cust09211.telefonica-ca.net 216.184.106.211
| Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11
.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.access.forms:268512
| X-Tomcat-NG: microsoft.public.access.forms
|
| Hello!
|
| What I got:
| Access XP, an MDB in 2002 format.
| I got two forms: I have a form called "Retts", and a listbox called
| "lstRetts" in the form "RettList".
|
| What I want:
| I want to locate a record and make it the current record from Retts by
| double clicking on a row of the listbox in RettList.
|
| What I've done:
| I already know how to do it by opening the form and using o the 'open'
event
| of Retts:
| If Me.OpenArgs = "OpenFromList" then
| Me.CodRett.SetFocus
| DoCmd.FindRecord Forms!RettList.lstRetts, acEntire, ,
| acSearchAll, , acCurrent
| End If
|
| It works fine!!!, but my problem is when I double click on another item
from
| the list AND the form Retts is already open. Of course the open event
won't
| work. So.. how to handle this?
|
| What I need: How to locate, and move to the specified record in the list,
| even if the form Retts is already open?
| Note: I prefer not to aplly filters, 'cause I'd like to browse the records
| once a record is located.
|
| Please help me!
|
| Thanx!
|
| --
| ________________
| Jorge Novoa
| F.A. Arias & Muñoz
| El Salvador, C.A.
|
|
|
|
 
Back
Top