Paul Cooke
Registered User.
- Local time
- Today, 15:41
- Joined
- Oct 12, 2001
- Messages
- 288
Hi guys could someone tell me if it is possbile to requery a listbox on a main form, from the afterupdate event of a Subform?
I have a form called 'Vaccination' with a listbox called 'lstVaccinations'
On the mainform is the subform called 'VaccinationConsumablesSubform' the last control on this has a msgbox with yes / no response which works fine but I want to add a line to the vbyes AND the vbNo response that refreshes the lstVaccinations listbox.
what I have tried is....
this does set the focus to the cboStaffId control but it does not refresh the lstVaccination listbox and I have no idea why !!
any advice will be greatly recieved
many thanks
I have a form called 'Vaccination' with a listbox called 'lstVaccinations'
On the mainform is the subform called 'VaccinationConsumablesSubform' the last control on this has a msgbox with yes / no response which works fine but I want to add a line to the vbyes AND the vbNo response that refreshes the lstVaccinations listbox.
what I have tried is....
Code:
'Message to ask if another vaccine product needs to be entered
MsgResponse = MsgBox("Do you want to enter another vaccine?", vbQuestion + vbYesNo, "New Vaccine")
If MsgResponse = vbNo Then
Forms!Vaccination.cboStaffID.SetFocus
Forms!Vaccination.lstVaccinations.Requery
Else
Forms!Vaccination.lstVaccinations.Requery
End If
End Sub
this does set the focus to the cboStaffId control but it does not refresh the lstVaccination listbox and I have no idea why !!
any advice will be greatly recieved
many thanks