G
Guest
Hi. First of all, they give me A2K to work with here.....
There are three combo boxes on my form which I guess qualify as having the
'cascading' quality assigned to their inter-relationship(s). The 'first' is
called 'Primary', the 2nd 'Title' and the final/3rd one is called
'IRB_Number'. It probably needs to be remembered that when 'Primary' and
'Title' have been selected by a user, that 'IRB_Number' is uniquely solved
for (i.e. there will only be one IRB_Number the user can choosed from), so it
seems like a good idea to obviate the user having to choose from the last
named list of the 'IRB_Number' combo box.
Anyway, enough talk......here's the three SQL queries I have behind the
three controls I just enumerated in order:
SELECT DISTINCT Primary.PrimDescription
FROM [Primary]
ORDER BY Primary.PrimDescription;
SELECT Protocol.Description
FROM [Primary] INNER JOIN Protocol ON Primary.PrimaryID = Protocol.PrimaryID
WHERE (((Primary.PrimDescription)=[Forms]![Temporary Look Up]![Primary]));
SELECT Protocol.[IRB #]
FROM Protocol INNER JOIN [Primary] ON Protocol.PrimaryID = Primary.PrimaryID
WHERE (((Primary.PrimDescription)=[Forms]![Temporary Look Up]![Primary]) AND
((Protocol.Description)=[Forms]![Temporary Look Up]![Title]));
followed by their relevant VBA Event code:
Option Compare Database
Option Explicit
Private Sub Primary_AfterUpdate()
Me.Primary.Requery
Me.Title.SetFocus
Me.Title = "Enter"
Me.Title.Requery
Me.IRB_Number = "Enter"
Me.IRB_Number.Requery
End Sub
Private Sub Title_AfterUpdate()
Me.Title.Requery
Me.IRB_Number.SetFocus
Me.IRB_Number.Requery
Me.IRB_Number.Value = Me.IRB_Number.ItemData(0)
End Sub
This configuration 'sort of' works.....The ‘weird’ thing about the way it
works is that sometimes it will enter an IRB number in the control and other
times it won’t even though there are IRB numbers found in the ‘Protocol’
table for the Primary and Title combination the user chooses. When the IRB
number is not entered, clicking on the combo box arrow results in what looks
like a blank value.
Would anyone care to speculate about what's keeping this from working as it
should?
-Ted
There are three combo boxes on my form which I guess qualify as having the
'cascading' quality assigned to their inter-relationship(s). The 'first' is
called 'Primary', the 2nd 'Title' and the final/3rd one is called
'IRB_Number'. It probably needs to be remembered that when 'Primary' and
'Title' have been selected by a user, that 'IRB_Number' is uniquely solved
for (i.e. there will only be one IRB_Number the user can choosed from), so it
seems like a good idea to obviate the user having to choose from the last
named list of the 'IRB_Number' combo box.
Anyway, enough talk......here's the three SQL queries I have behind the
three controls I just enumerated in order:
SELECT DISTINCT Primary.PrimDescription
FROM [Primary]
ORDER BY Primary.PrimDescription;
SELECT Protocol.Description
FROM [Primary] INNER JOIN Protocol ON Primary.PrimaryID = Protocol.PrimaryID
WHERE (((Primary.PrimDescription)=[Forms]![Temporary Look Up]![Primary]));
SELECT Protocol.[IRB #]
FROM Protocol INNER JOIN [Primary] ON Protocol.PrimaryID = Primary.PrimaryID
WHERE (((Primary.PrimDescription)=[Forms]![Temporary Look Up]![Primary]) AND
((Protocol.Description)=[Forms]![Temporary Look Up]![Title]));
followed by their relevant VBA Event code:
Option Compare Database
Option Explicit
Private Sub Primary_AfterUpdate()
Me.Primary.Requery
Me.Title.SetFocus
Me.Title = "Enter"
Me.Title.Requery
Me.IRB_Number = "Enter"
Me.IRB_Number.Requery
End Sub
Private Sub Title_AfterUpdate()
Me.Title.Requery
Me.IRB_Number.SetFocus
Me.IRB_Number.Requery
Me.IRB_Number.Value = Me.IRB_Number.ItemData(0)
End Sub
This configuration 'sort of' works.....The ‘weird’ thing about the way it
works is that sometimes it will enter an IRB number in the control and other
times it won’t even though there are IRB numbers found in the ‘Protocol’
table for the Primary and Title combination the user chooses. When the IRB
number is not entered, clicking on the combo box arrow results in what looks
like a blank value.
Would anyone care to speculate about what's keeping this from working as it
should?
-Ted