Solved

Database Question

Posted on 2001-09-17
2
148 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
2 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 50 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now