473,598 Members | 2,916 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

List box and command button.

10 New Member
I've created a list box with employee names in it. when highlighting and clicking the search command button i've created it does nothing... can someone give me a code to use so when selecting the employee and hitting search it goes to that users information.
Oct 23 '06 #1
2 4439
Tanis
143 New Member
What is the code you have so far? Table names, fieldnames and form name would help.
Oct 23 '06 #2
MMcCarthy
14,534 Recognized Expert Moderator MVP
In the On Click Event of the button ('cmdSearch' for this example) put the following code.

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private cmdSearch_OnClick()
  3. Dim stDocName As String
  4. Dim stLinkCriteria As String
  5.  
  6.    stDocName= "Name of Employee record form"
  7.    stLinkCriteria="EmployeeID=" & Me.ListBoxName
  8.  
  9.    DoCmd.OpenForm stDocName, , , stLinkCriteria
  10.  
  11. End Sub
  12.  
I've created a list box with employee names in it. when highlighting and clicking the search command button i've created it does nothing... can someone give me a code to use so when selecting the employee and hitting search it goes to that users information.
Oct 23 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
9282
by: Chris Bolus | last post by:
I'm a teacher using MS Access on an RMConnect 2.4 network. On some workstations both I and my students sometimes get an error message when attempting to insert a command button on a form which reads "Invalid use of null". The remainder of the options in the Command Button Wizard are then unavailable and the button wil not work. The only solution is to log on to a different workstation. Any ideas?
4
3517
by: Theo Jansen | last post by:
Hi, i'm making an application in Access and in the query made, i'd like the user to fill in a parameter when opening the query (in a report). It's much easier for the user if the parameter was a dropdown list from which he can select, because the parameters are rather long... Does anyone know how to make that dropdown list? TIA
5
4219
by: Vigneshwar Pilli via DotNetMonster.com | last post by:
string connectionString1 = "server=(local); user=sa;password=sa; database=sonic"; System.Data.SqlClient.SqlConnection dbConnection1 = new System.Data.SqlClient.SqlConnection(connectionString1); System.Data.SqlClient.SqlCommand dbCommand1 = new System.Data.SqlClient.SqlCommand();
3
3016
by: Shawn H. Mesiatowsky | last post by:
I have an array list that I want to display to the browser. I need very precise control of the repeater, so I have function for the OnItemDataBound event for the repater, then in that function I have my code to alter the displayed data. for instance, I need to display a button on the client side with client side script. I cannot accomplish this using the Button web control, so instead I use a label and in the text of the label I set it to...
6
2735
by: AA Arens | last post by:
Hi, I have a database with 2 main forms. Contacts and companies. I share the base with two others via LAN. On the companies form I have buttons to navigate throught the records (>400). We are mostly handling let say 5 companies. Every time I have to navigate or choose the find record button to get the right company. I am looking fo a feature to have listed in a combo list the last 5 visited records ("recently visited records").
0
1430
by: daveleominster | last post by:
I am trying to read in a XML file into to vb.net say I have a text box and I am searching for a command "Aname" I enter the text and push the button, I want my syntax info and summary info to appear on the next form in a two separate list box. So I am thinking a loop and if statements are need. What do you suggestion for the vb code Next if the there is no commandname that match then it search for a keyword and then lists the commands...
7
4504
by: ljungers | last post by:
Have Form-1 with 3 text boxes and 1 command button. With any of the 3 boxes filled out and button is clicked, a Macro is performed that Opens a Query that has a WHERE clause that uses the 3 test boxes of data from form-1. 1) How do I cause the SQL command window not to show for that SQL command? The query results is placed in a ListBox on Form-2 and desired rows in the list box are selected/clicked, followed by a click on a button that...
12
9793
by: ljungers | last post by:
I'm on the home streach of my project and found that my "Reset for New Search" command button not working as desired. What should happen is that when the button is clicked a Event Procedure is run. That event procedure should clear the text boxes that are used for a search query that loads the results into a list box on that same form. When clicked, all is cleared in the text boxes, and the list box is cleared but shows column seperator lines...
3
51371
by: Killer42 | last post by:
Here's a simple VB6 code snippet that uses the FileSystemObject model to find all the files in C:\Temp and load their names into a listbox. To use this sample, you need to set things up as follows: Create a new project in VB6 Add a form (this will probably happen by default, anyway) Pull down the Project menu and choose References. Find Microsoft Scripting Runtime and fill in the checkbox to select it. Click OK. Add a ListBox control to...
4
1977
by: Clint Schaefer | last post by:
Apologies in advance. I've seen similar questions, but none of the solutions seem to be working for me... I have a form that allows a user to select mutiple items (payroll deduction codes) in a list box. The values are drawn from a table called PayrollCodes. In the second list box, the user chooses a category that the items from the first list belong to. I have a command button with code attached to the OnClick Event that then records the...
0
7981
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7894
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8284
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8392
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8262
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6711
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5847
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5437
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
1245
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.