Solved

Database Question

Posted on 2001-09-17
2
152 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 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
Suggested Courses
Course of the Month7 days, 23 hours left to enroll

617 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