Hello,
I'd be very grateful for some help, here.
I'm floundering about in Access, based on what I can remember of VB and SQL from twenty years ago, so not a good start...
I have a form which has two ListBox controls on it - the first, lstModule is populated from a local database when the form is opened, using the following RowSource property:
I have a second ListBox control on the same form which isn't bound to a table, called lstAssessment.
In the AfterUpdate event of lstModule, I have the following code/expression:
The functionality I'm going for is that, when you select an item in lstModule, lstAssessment updates itself.
The problem is that lstAssessment never updates and is always empty. I've tried putting the following in lstModule_onMouseUp to force lstAssessment to update:
...but with no effect.
Through extensive msgbox debugging, I have found that the correct value is being passed by [lstModule].[Value] and that, whilst I can pull values back from lstAssessment in the lstModule events, I can't seem to push values onto it (e.g. I can retrieve the defaultValue property, but can't set it).
If anybody can explain what I'm doing wrong, I'd be very grateful.
Thanks
I'd be very grateful for some help, here.
I'm floundering about in Access, based on what I can remember of VB and SQL from twenty years ago, so not a good start...
I have a form which has two ListBox controls on it - the first, lstModule is populated from a local database when the form is opened, using the following RowSource property:
SQL:
SELECT module.ID, module.code, module.title
FROM [module]
ORDER BY module.[code], module.[title];
I have a second ListBox control on the same form which isn't bound to a table, called lstAssessment.
In the AfterUpdate event of lstModule, I have the following code/expression:
Code:
=[lstAssessment].[RowSource]="SELECT id,title,description FROM assessment WHERE moduleID = " & [lstModule].[Value]
The functionality I'm going for is that, when you select an item in lstModule, lstAssessment updates itself.
The problem is that lstAssessment never updates and is always empty. I've tried putting the following in lstModule_onMouseUp to force lstAssessment to update:
Code:
=[lstAssessment].[requery]
Through extensive msgbox debugging, I have found that the correct value is being passed by [lstModule].[Value] and that, whilst I can pull values back from lstAssessment in the lstModule events, I can't seem to push values onto it (e.g. I can retrieve the defaultValue property, but can't set it).
If anybody can explain what I'm doing wrong, I'd be very grateful.
Thanks