Requery combo box on subform

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
 
A

Andy

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.
 
S

Steve Schapel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top