Refresh combo query

P

peashoe

I have a combo box in a subform that uses the following query:
SELECT [TeamMascot].[TeamMascotName] FROM [TeamMascot] WHERE [School Or
Organization ID] = [Forms]![Registrations]![txtID] ORDER BY
[TeamMascotName];

basically, I need the Team Mascot name for the current record. This is
working fine, but when I go to the next record, the drop down is the
same as the old record. I need it to pull the current record (School Or
Organization) - like a refersh or something. Does anyone know what I
need to do?

Thanks in advance
Lisa
 
A

Alessandro Baraldi

(e-mail address removed) ha scritto:
I have a combo box in a subform that uses the following query:
SELECT [TeamMascot].[TeamMascotName] FROM [TeamMascot] WHERE [School Or
Organization ID] = [Forms]![Registrations]![txtID] ORDER BY
[TeamMascotName];

basically, I need the Team Mascot name for the current record. This is
working fine, but when I go to the next record, the drop down is the
same as the old record. I need it to pull the current record (School Or
Organization) - like a refersh or something. Does anyone know what I
need to do?

Thanks in advance
Lisa

On Current Event

Me!ComboName.Requery

@Alex
 
P

peashoe

Perfect!
Thanks Alessandro

~L~

Alessandro said:
(e-mail address removed) ha scritto:
I have a combo box in a subform that uses the following query:
SELECT [TeamMascot].[TeamMascotName] FROM [TeamMascot] WHERE [School Or
Organization ID] = [Forms]![Registrations]![txtID] ORDER BY
[TeamMascotName];

basically, I need the Team Mascot name for the current record. This is
working fine, but when I go to the next record, the drop down is the
same as the old record. I need it to pull the current record (School Or
Organization) - like a refersh or something. Does anyone know what I
need to do?

Thanks in advance
Lisa

On Current Event

Me!ComboName.Requery

@Alex
 
A

Al Campagna

peashoe,
Use the OnCurrent event of the form...
MyComboBoxName.Requery
to force a requery every time you visit/browse to a different record.

Also, if the combo relies on another field on the form, then Requery the
combo on the AfterUpdate event of that field
(ex. your [Forms]![Registrations]![txtID])
 

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

Top