Requery listbox runtime error 438

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?
 
K

Ken Snell [MVP]

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
 
G

Guest

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!
 

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