473,396 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Question on listbox and opening form

Hi,

I have an issue that I am trying to resolve. I am populating a list
box with employee names and would like to have the capability for a
user to open an employee record by double clicking on the emplpoyee
name in the listbox. Is this possible to do?

Thanks,

Daniel Hidalgo
Nov 12 '05 #1
2 1258
Depending on structure, you can cerainly do this. You would have an employee
form bound to an employee table. The list box would have a column for the
record id of the employee records and the employee names. If you set the
bound column of the list box to the record id of the employee records and
then you can reference the value of that control in your openform statement.

In the doubleclick event of the list box, run the docmd.openform and pass
the record id as a criteria...

DoCmd.OpenForm "frmEmployee", , , "emp_no = " & Me.lstEmployees

hth
Chris
"Daniel Hidalgo" <hd*****@hotmail.com> wrote in message
news:ea*************************@posting.google.co m...
Hi,

I have an issue that I am trying to resolve. I am populating a list
box with employee names and would like to have the capability for a
user to open an employee record by double clicking on the emplpoyee
name in the listbox. Is this possible to do?

Thanks,

Daniel Hidalgo

Nov 12 '05 #2
hd*****@hotmail.com (Daniel Hidalgo) wrote in message news:<ea*************************@posting.google.c om>...
Hi,

I have an issue that I am trying to resolve. I am populating a list
box with employee names and would like to have the capability for a
user to open an employee record by double clicking on the emplpoyee
name in the listbox. Is this possible to do?

Thanks,

Daniel Hidalgo


Except you can't use the Multi-Select option of the listbox if you
want to do this. If you did, you would have to loop through the
ItemsSelected collection of the listbox and create a valid WHERE
statement that you could pass to the form you would be opening. You
can get code for it at www.mvps.org
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Simon P | last post by:
Hello group, I'm in desperate need of help. Here goes : I have the following tables : CONTACTS (ContactID, FirstName, LastName, Company, etc.), SHOWS (ShowID, ShowDescription) and SHOWDETAILS...
3
by: Simon Rowe | last post by:
Probably really simple but I cant work it out... I have a list box on a form with a few records in. When I open the form the first record is sort of highlight with a dashed box, when I cursor...
2
by: jpalmerx | last post by:
Hi, I have a form in Access with a listbox containing some choices. There is a "Select" button underneath that runs a macro opening a form that acts on the selected value. What I can't figure...
4
by: news | last post by:
Not really sure if this is a javascript problem or C# - sorry if in wrong place. Modal Forms Question in Web Application I have two web forms: Form1 and Form2 Form1 calls Form2 using...
3
by: astro | last post by:
I want to build a Filter form that displays a list of values in a listbox which the user selects from. The values in this listbox are passed to the filterform. When the user closes this filter...
3
by: Ali Chambers | last post by:
Hi, I have created a listbox called "dtlist1" on my VB.NET form. I call a procedure as follows: Private Sub openfile(flname As String) dtlist1.Items.Clear() etc..
1
by: John | last post by:
Using Access 2007 I find that, on opening a form, a listbox control always displays one of the values in the list, even if no value has been selected. Thus, the first value in the list is...
7
by: Randy | last post by:
Hi, I've got a listbox on a form that gets updated by opening another form for data entry. Once the user enters the new item name and clicks "accept", the data entry form closes and the original...
1
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
I've got a ListBox on my Visual Studio C# form with several entries (14,000). I have to put a search field on the form. As text is entered into the search field, I want the ListBox to remove...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.