How can I simply capture a value from one of my tables and assign it to a variable for use in a form?
I'm developing a windows app with a local database connection. The database is an MS Access 2003 mdb file, and is functioning basically the same as SQL Server--with a datasource, databindingsource, and tableadapter.
One of my forms has no bound controls (however, I can add the databindingsource if necessary). I need to capture a value from one of my tables and assign it to a variable for use in the form.
Here's what I want to get:
select ParentID from Position where PositionID = '1'
MS Access has a VB
function that does it in one line:
var = DLookup ( expression, domain, [criteria] )
var = DLookup ( "ParentID", "Position", "PositionID = '1'" )
Doesn't VB2005 have something similar? Or how can I issue a simple sql command?