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 | Calendar | 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 February 22nd, 2006, 03:49 AM
Registered User
 
Join Date: Feb 2006
Location: London, Hertfordshire, United Kingdom.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Nayt32
Default searching a table for values



Im a computing student that is a little stuck, im creating a stock control system and want to be able to search a table for a specific product in the product table. the only problem is that i want it to run off of a double click on a list box, this will then open a form that shows all the attributes of that product.

Please help, any ideas will be kewl :) :)


The only way forward is to understand the past
Reply With Quote
  #2 (permalink)  
Old February 22nd, 2006, 05:32 PM
Authorized User
 
Join Date: Feb 2006
Location: , , .
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Did you try Recordset object?

Reply With Quote
  #3 (permalink)  
Old February 24th, 2006, 09:55 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

The double-click should open the form that's based on the table (or a query based on that table) with a WHERE statement.

Suppose your listbox is called lstMyList and the product field is called strMyProduct and the second form is called frmMyResult. Then in the listbox's double-click event, you'd have something like this:

DoCmd.OpenForm "frmMyResult", , , "[strMyProduct] = '" & Me.lstMyProduct & "'"

The second form will open and will be filtered to only those products.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote
  #4 (permalink)  
Old February 24th, 2006, 09:56 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Oops... typed too fast... here is a correction:

DoCmd.OpenForm "frmMyResult", , , "[strMyProduct] = '" & Me.lstMyList & "'"


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote
  #5 (permalink)  
Old February 27th, 2006, 11:19 AM
Registered User
 
Join Date: Feb 2006
Location: London, Hertfordshire, United Kingdom.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Nayt32
Default

its worked fine but it is not giving the information that that producte has, the second form has all the information regarding that where abouts of the product, and unfortunately these have to be shown as well.

Thank you :) :)

The only way forward is to understand the past
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
Comparinng Two Values from same table MArgente Access 1 June 12th, 2007 04:06 PM
Searching and Checking Values in other workbooks lavaguava13 Excel VBA 1 September 17th, 2005 04:15 PM
help - how to get different values from same table surajguru BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 4 July 22nd, 2005 12:39 PM
Problem searching for NULL values ltdanp21 SQL Language 2 June 16th, 2004 06:52 PM
String Searching in a Table umagrama Access VBA 3 December 5th, 2003 12:25 PM



All times are GMT -4. The time now is 05:59 AM.


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