Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Requery not working on Tab Form 1

Status
Not open for further replies.

cmmrfrds

Programmer
Feb 13, 2000
4,690
US
I am requering a listbox after the user has made a selection to turn off the selection. Maybe there is a better way to do it, but it works on a stand alone form but not when I add the Form to a Tab Form. SEE CODE. The error is: &quot;apply filter&quot; not allowed. when the &quot;Yes&quot; path is followed on the if.<br>
<br>
'--- Do requery depending on where invoked from<br>
Dim FormToCheckFor As String, retmsg As String<br>
FormToCheckFor = &quot;MotorDataEntry&quot;<br>
retmsg = SeeIfFormLoaded(FormToCheckFor)<br>
If retmsg = &quot;Yes&quot; Then<br>
'''Forms!MotorDataEntry.AllowFilters = True<br>
DoCmd.Requery &quot;Forms!MotorDataEntry!CBAccessoryType&quot;<br>
Else<br>
DoCmd.Requery &quot;CBAccessoryType&quot;<br>
End If<br>
<br>

 
Thanks WP. It solved the problem!!<br>
<br>
Using the &quot;method&quot; worked in both instances of standalone or in the tab form. When I first tried the method I got a different error but it allowed me to see that I was missing a level in my Form hierarchy. I went back and tried the DoCmd again but it still gave me the same error message. Thanks again.
 
I think you need forms!formname!tabname!controlname.requery
 
That is what I used. Here is the code that worked.<br>
<br>
Forms!MotorDataEntry!tabsubformEquipmentAttachments!CBAccessoryType.Requery
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top