If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Update listbox on a tab
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 |
#2
|
|||
|
|||
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 |
#3
|
|||
|
|||
Update listbox on a tab
On Jan 9, 10:17*am, Maurice wrote:
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- Hide quoted text - - Show quoted text - Works Great! thanks for your help! |
Thread Tools | |
Display Modes | |
|
|