Requery combo box on subform

  • Thread starter Thread starter DeVille
  • Start date Start date
D

DeVille

Hi I am having problems with requery command
I have this combo box[NaneOfSignatory] on a sub form
(ExecutionChecklistForm), it uses a query as its row
source. The query(SignatoryQuery) finds all the Signatory
Names from a list in the (ParticipantDetailsTable) . The
names of people the query returns are all signatory names
from the business which is currently in the
[BusinessName] combo box on the main form. This works
fine until I change the business name in [BusinessName]
combo box which should also change the list of signatory
names to chose from in the [NameOfSignatory] combo box,
but it does not requery. Ps if I close the form then
reopen it with a different name in the [BusinessName] box
it chooses the correct signatory names, so I am sure my
query function is working, its just just the requery bit
that's the problem.

(Query)

SELECT ParticipantDetailsTable.[Participant Name]
FROM ParticipantDetailsTable
WHERE (((ParticipantDetailsTable.BusinessName)=[Forms]!
[LocationDetailsForm]![BusinessName]));

(Sub.NOTE.this is the part that is not working)

Private Sub BusinessName_AfterUpdate()

Me!NameOfSignatory.Requery

End Sub
if anyone can help thanks in advance
 
This is gonna sound silly but its happened to me before.
Did you confirm that the BusinessName control has [Event
Procedure] under the control property for AfterUpdate?

Another thing you may want to try is to put a breakpoint
in the VB code below to insure it is executing when you
expect it to.
 
DeVille,

You need to correctly reference the combobox on the subform. Try...
Private Sub BusinessName_AfterUpdate()
Me.ExecutionChecklistForm.Form!NameOfSignatory.Requery
End Sub

- Steve Schapel, Microsoft Access MVP
 
Back
Top