Connecting Tech Pros Worldwide Forums | Help | Site Map

Refresh not available!!!

Newbie
 
Join Date: Jul 2006
Location: Islamabad,Pakistan
Posts: 15
#1: Aug 10 '06
Hi.
I am using form and subform in which form has combo boxes that sets the criteria for the query. i am using grouping in the select query and the contents of the query are displayed in the subform. as soon as i set the criteria in the query, the contents of the query are not displayed in the subform and the refresh button genrats the error statement "The Command or Action 'Refresh' isn't available now." please tell me the reason of this problem and its solution.

Newbie
 
Join Date: Jul 2006
Posts: 16
#2: Aug 10 '06

re: Refresh not available!!!


I used this snip of code for a similar problem I was having.
On the event for before your subform should populate the data, call this public sub.
Make sure you change my form name to your object name.

Public Sub RequeryList()
'This was copied from the HELP section of MS Access
'It makes the list box refresh the information based on the
'selection made in the combo box

Dim ctlCombo As Control

' Return Control object pointing to a combo box.
Set ctlCombo = Forms!frmSectionSelect!lstParaInfo

' Requery source of data for list box.
ctlCombo.Requery

End Sub
Reply