First things first - using MSAccess97 - my records are related by RecordID ( in tblMain) to RecordIDAdditional (in tblAdditional)
Records are added to tblAdditional by using unbound frmAdditional(code is used to pass through data). Records in tblMain are viewed by using bound frmMain
I want to set the Enabled property of a command button (on frmMain) set to True when I am in a record (tblMain)which already has additional related records present (in tblAdditional).
I need to find the recordset where 2 parameters are met i.e. the records where recordID = RecordIDAdditional and where another field Identifier (in tblAdditional) has to = True (set to true by entering info from frmAdditional)
I thought about using the following method dim db rs=db.OpenRecordset {SQL String} if RecordCount > 0 Then Enabled = True ) but I cant seem to do the SQL bit!
(I have done it the other way aroud ie setting Enabled = True when I add a record to tblAdditional using frmAdditional - but this isnt what I need!)
I thought the SQL should look something like this :
Set rs = db.OpenRecordset ("SELECT * FROM tblMain INNER JOIN tblAdditional ON Main.RecordID = tblAdditional.RecordIDAdditional
WHERE (((tblAdditional.RecordIDAdditional)=tblMain.RecordID) AND ((tblAdditional.Identifier)=True));")
Please help as this is getting a little fustrating.....!
Many thanks
Records are added to tblAdditional by using unbound frmAdditional(code is used to pass through data). Records in tblMain are viewed by using bound frmMain
I want to set the Enabled property of a command button (on frmMain) set to True when I am in a record (tblMain)which already has additional related records present (in tblAdditional).
I need to find the recordset where 2 parameters are met i.e. the records where recordID = RecordIDAdditional and where another field Identifier (in tblAdditional) has to = True (set to true by entering info from frmAdditional)
I thought about using the following method dim db rs=db.OpenRecordset {SQL String} if RecordCount > 0 Then Enabled = True ) but I cant seem to do the SQL bit!
(I have done it the other way aroud ie setting Enabled = True when I add a record to tblAdditional using frmAdditional - but this isnt what I need!)
I thought the SQL should look something like this :
Set rs = db.OpenRecordset ("SELECT * FROM tblMain INNER JOIN tblAdditional ON Main.RecordID = tblAdditional.RecordIDAdditional
WHERE (((tblAdditional.RecordIDAdditional)=tblMain.RecordID) AND ((tblAdditional.Identifier)=True));")
Please help as this is getting a little fustrating.....!
Many thanks