Solved

Database Question

Posted on 2001-09-17
2
147 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
Comment Utility
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
Comment Utility
Thanks for the great answer, it works fine now

MICK
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

771 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

12 Experts available now in Live!

Get 1:1 Help Now