Requery listbox runtime error 438

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to requery a list box to show changes made to a record, but
keep getting runtime error 438, saying the "Object doesn't support this
property or method." However, the method and syntax were suggested by
MS Access Help.

The code is as follows:

Function RefreshFrmProjectsSelect()
Dim ctlList As Control

Set ctlList =
Forms!FrmSupDailyTabbed.FrmProjectsNew.FrmSelect.List17

ctlList.Requery


End Function


FrmSupDailyTabbed is the main form. FrmProjectsNew is the name of the
subform control. FrmSelect is the form displayed in the subform
control, and list17 is the list box. Any ideas why it'd say it's not
supported?
 
Your syntax for referring to a control on a subform isn't quite right. Try
this:

Forms!FrmSupDailyTabbed.FrmProjectsNew.Form.List17


Also, the use of the intermediate ctlList variable is unnecessary.

Function RefreshFrmProjectsSelect()
Forms!FrmSupDailyTabbed.FrmProjectsNew.Form.List17.Requery
End Function
 
That's it. Worked like a charm. I've spent most of the day trying
different variations with or without variables, changing the syntax,
making reference back to the help files, etc. Thanks so much!
 
Back
Top