Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 21st, 2005, 12:34 PM
Registered User
 
Join Date: Jun 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default listbox selection

Good afternoon,

I have two problems I can't seem to figure out, both regarding a listbox.

I have a listbox that is populated with several different fields. Here is the sql I use to populate the box:

SELECT DepartmentGoals.DepartmentGoalID, DepartmentGoals.Name, DepartmentGoals.Importance, DepartmentGoals.Open FROM DepartmentGoals ORDER BY [Open], [Importance], [Name];

What I want to do is: when the form containing the box opens select a particular listing (via the DepartmentGoals.DepartmentGoalID field) in the listbox.

Also, when a user clicks on a new list in the box I want to trigger an event that will extract the DepartmentGoals.DepartmentGoalID selected from the listbox.

I cannot seem to find the property or method to access this information though. Any help would be greatly appreciated.

Thanks,

Jonathon

Reply With Quote
  #2 (permalink)  
Old June 21st, 2005, 01:35 PM
Registered User
 
Join Date: Apr 2005
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Kevinsharrison
Default

I think this is what you want, this is how I have done this in the past. I use the double click event. Then it will take the data of the bound column. Then i would open another form based on the info. I think that is what you are trying to do.

Private Sub listbox_DblClick(Cancel As Integer)
Dim strlstData As String
Dim strCriteria As String
Dim i

For Each i In lstStnBOAll.ItemsSelected
  strlstData = lstStnBOAll.ItemData(i)
Next

strCriteria = "[Broadcast_Num]= " & strlstData
DoCmd.OpenForm "frmBroadcastorder", , , strCriteria

End Sub

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
About listbox selection mode chandra_yvr ASP.NET 2.0 Basics 1 April 3rd, 2007 07:50 AM
ListBox Item selection caterpillar ASP.NET 1.0 and 1.1 Professional 1 July 26th, 2006 12:50 PM
ListBox Value Selection problem caterpillar General .NET 0 July 26th, 2006 11:41 AM
Multiple Selection of Listbox jasminecyriac ASP.NET 2.0 Basics 0 June 22nd, 2006 05:20 AM
Listbox selection in a form jpcoutts Access 1 November 10th, 2004 05:02 PM



All times are GMT -4. The time now is 02:50 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.