Update listbox on a tab
Try this:
Private Sub TabCtl_MngProjects_Change()
me.tabctl.pages("pagename").controls.item("List17" ).Requery
End Sub
Where Pagename is the name of your second tab. You can also set the
pageindex number which will prob. be 1 or 2. In that case don't put quotes
around it.
hth
--
Maurice Ausum
" wrote:
Hi,
I have a tabcontrol on a form that contains two tabs. The first tab
is used to enter new projects into a table. On the second tab I am
using a listbox to view the projects, the problem that I am having is
that when the new records are added into the table from the first tab
the listbox only updates with the new record when I close and reopen
the form. I tried using the code below to requery the data when the
tabs are changed but it's not working and I am only a novice at VBA so
I don't even know if it is right. Please help, below is the code I
was using to updated the listbox. Thanks
Private Sub TabCtl_MngProjects_Change()
List17.Requery
End Sub
|