Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Database Question

Posted on 2001-09-17
2
Medium Priority
?
154 Views
Last Modified: 2010-05-02
Hi, I have a program which access a database (ACCESS).
it does this using two datacontrols and a dbgrid control. the data in the data control is displayed using the following lines in the reposition event of data1.
Data2.RecordSource = "select bookedto, bookeddate, expectedreturn from tblBookingInfo where fgn_DWGINFO = " & Data1.Recordset.Fields("bmk_DWGINFO") & ""
Data2.Refresh

that worked fine, but what I want to do is display a record that corresponds with an item that i click on in a list box.
I put the following line into the click event of the listbox

Data1.RecordSource = "select FILENAME from tblDrawingInfo where filename = '" & List1.Text & "'"
Data1.Refresh

this find the right record but throws up the following error when the data1 controls reposition event fires

"item not found in this collection"
the following seems to be the culprit
Data1.Recordset.Fields("bmk_DWGINFO") & ""
how can i correct this

thanks in advance

MICK
0
Comment
Question by:Mick_Buckley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 200 total points
ID: 6487272
YOu are not selecting this field in the select list: FILENAME

Add the appropriate field to the select list:

"select FILENAME,bmk_DWGINFO from tblDrawingInfo where filename = '" & List1.Text & "'"

0
 

Author Comment

by:Mick_Buckley
ID: 6487489
Thanks for the great answer, it works fine now

MICK
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question