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
|
|||
|
|||
Option buttons and tabs
Hi,
I would like to ask two questions: 1: When a user selects an option button the appropriate tab control with a sub form is activated. However, I would like to lock this to the option button, and not allow the user to change to a different tab if not changing the option first. How is it possible? 2: When entering a new record the option button works fine and selects the appropriate tab control. However, when using the record navigation control and step to the next record, the tab control does not reflect the option control selected for the record. Can you please help? Thank you, Aniko |
#2
|
|||
|
|||
Option buttons and tabs
"Aniko" wrote in message
Hi, I would like to ask two questions: 1: When a user selects an option button the appropriate tab control with a sub form is activated. However, I would like to lock this to the option button, and not allow the user to change to a different tab if not changing the option first. How is it possible? One possibility: get rid of the tabs by setting the tab control's Style property to None. Another possibility (untested): use code in the tab control's Change event to set the tab control back to the appropriate page as specified by the option group. Note that you can set the tab control to a particular page by setting its Value property to the PageIndex property of the desired page. 2: When entering a new record the option button works fine and selects the appropriate tab control. However, when using the record navigation control and step to the next record, the tab control does not reflect the option control selected for the record. Use the code in the form's Current event to set the tab control to the correct page as indicated by the option group's value. Can you please help? Is that sufficient? -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) |
#3
|
|||
|
|||
Option buttons and tabs
Thanks Dirk,
Your first recommendation for Question No1 works well and it is easy. For Question No2, unfortunately I am unable to code the tab control, as I do not have much knowledge of VB. I have some logic of how it should be done, but no codes. I believe for the Form's property - On Current I need to code an [Event Procedure] to do something like this: Get the tab index number for the Option group (eg. 10) Get the Option value of the Option button selected (eg. 1) Get the tab index number for the tab inside the Tab Control But I just found out, that the different tabs inside the tab control have no tab index numbers:-( So what's next? Your help is much appreciated. Aniko But I am unable to code your other recommendations -----Original Message----- "Aniko" wrote in message Hi, I would like to ask two questions: 1: When a user selects an option button the appropriate tab control with a sub form is activated. However, I would like to lock this to the option button, and not allow the user to change to a different tab if not changing the option first. How is it possible? One possibility: get rid of the tabs by setting the tab control's Style property to None. Another possibility (untested): use code in the tab control's Change event to set the tab control back to the appropriate page as specified by the option group. Note that you can set the tab control to a particular page by setting its Value property to the PageIndex property of the desired page. 2: When entering a new record the option button works fine and selects the appropriate tab control. However, when using the record navigation control and step to the next record, the tab control does not reflect the option control selected for the record. Use the code in the form's Current event to set the tab control to the correct page as indicated by the option group's value. Can you please help? Is that sufficient? -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) . |
#4
|
|||
|
|||
Option buttons and tabs
wrote in message
Thanks Dirk, Your first recommendation for Question No1 works well and it is easy. Great. For Question No2, unfortunately I am unable to code the tab control, as I do not have much knowledge of VB. I have some logic of how it should be done, but no codes. I believe for the Form's property - On Current I need to code an [Event Procedure] to do something like this: Get the tab index number for the Option group (eg. 10) Get the Option value of the Option button selected (eg. 1) Get the tab index number for the tab inside the Tab Control But I just found out, that the different tabs inside the tab control have no tab index numbers:-( So what's next? You're being confused by the similarity between "tab index" and "page index" on the one hand, and "tab index" and "tab control" or "tab page", on the other. It's not actually the Tab Index property that you're interested in at all, but the Page Index property of the tab control's pages. If you built your option group using the Option Group Wizard, and let it pick the option values, it will have assigned them values in sequence -- 1, 2, 3, and so on. The Page Index properties of a tab control, by contrast, are numbered sequentially starting at 0 -- 0, 1, 2, and so on. The simplest way to have your tab control pages correspond to the options of the option groupc is to have page 0 correspond to option 1, page 1 correspond to option 2, and so on. That way all you have to do is set the tab control's value to the (option group value - 1). Let me give you some example code. This code will use the following "invented names" for your controls: optMyOptionGroup - the option group frame whose value you want to use to determine which page is shown on the tab control. tabMyTabControl - the tab control you want to control. To change pages on the tab control when the option group is updated, you might have an event procedure for the option group like this: Private Sub optMyOptionGroup_AfterUpdate() Me.tabMyTabControl = Me.optMyOptionGroup - 1 End Sub To make sure that the tab control shows the correct page as you move from record to record, you would repeat the central line of code from the above procedure in an event procedure for the form's Current event: Private Sub Form_Current() Me.tabMyTabControl = Me.optMyOptionGroup - 1 End Sub And that would be all you need, in this ideal case. If the relationship between the option chosen and the specific tab page is more complicated than that, you would need slightly more elaborate code than that. Let me know if that's the case, and if you need help with it. -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) |
#5
|
|||
|
|||
Option buttons and tabs
Thank you so much, you cleared my confusion and solved a
problem I was having for two weeks. Thanks again, Aniko -----Original Message----- wrote in message Thanks Dirk, Your first recommendation for Question No1 works well and it is easy. Great. For Question No2, unfortunately I am unable to code the tab control, as I do not have much knowledge of VB. I have some logic of how it should be done, but no codes. I believe for the Form's property - On Current I need to code an [Event Procedure] to do something like this: Get the tab index number for the Option group (eg. 10) Get the Option value of the Option button selected (eg. 1) Get the tab index number for the tab inside the Tab Control But I just found out, that the different tabs inside the tab control have no tab index numbers:-( So what's next? You're being confused by the similarity between "tab index" and "page index" on the one hand, and "tab index" and "tab control" or "tab page", on the other. It's not actually the Tab Index property that you're interested in at all, but the Page Index property of the tab control's pages. If you built your option group using the Option Group Wizard, and let it pick the option values, it will have assigned them values in sequence -- 1, 2, 3, and so on. The Page Index properties of a tab control, by contrast, are numbered sequentially starting at 0 -- 0, 1, 2, and so on. The simplest way to have your tab control pages correspond to the options of the option groupc is to have page 0 correspond to option 1, page 1 correspond to option 2, and so on. That way all you have to do is set the tab control's value to the (option group value - 1). Let me give you some example code. This code will use the following "invented names" for your controls: optMyOptionGroup - the option group frame whose value you want to use to determine which page is shown on the tab control. tabMyTabControl - the tab control you want to control. To change pages on the tab control when the option group is updated, you might have an event procedure for the option group like this: Private Sub optMyOptionGroup_AfterUpdate() Me.tabMyTabControl = Me.optMyOptionGroup - 1 End Sub To make sure that the tab control shows the correct page as you move from record to record, you would repeat the central line of code from the above procedure in an event procedure for the form's Current event: Private Sub Form_Current() Me.tabMyTabControl = Me.optMyOptionGroup - 1 End Sub And that would be all you need, in this ideal case. If the relationship between the option chosen and the specific tab page is more complicated than that, you would need slightly more elaborate code than that. Let me know if that's the case, and if you need help with it. -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) . |
#6
|
|||
|
|||
Option buttons and tabs
Hi Dirk,
I do not exactly know what happened, but the problem you originally helped me with, came back. After everything worked well in the original form, where I designed tabs and inserted sub forms, I decided to design the switchboard. I tried to set up the switchboard few times, but even with only one button on it, which was meant to take me to the above mentioned form, did not work. Kept coming up with errors: "Error accessing file, network connection may have been lost." I decided to delete the switchboard and try again. No luck. Tried to create other form with command button to link to the form, no luck. And then I went back to the original form, and looked at the On Current Event Procedure and there is nothing there. I am unable to key in anything and getting the same error message when I try. Pleas help, Aniko -----Original Message----- Thank you so much, you cleared my confusion and solved a problem I was having for two weeks. Thanks again, Aniko -----Original Message----- wrote in message Thanks Dirk, Your first recommendation for Question No1 works well and it is easy. Great. For Question No2, unfortunately I am unable to code the tab control, as I do not have much knowledge of VB. I have some logic of how it should be done, but no codes. I believe for the Form's property - On Current I need to code an [Event Procedure] to do something like this: Get the tab index number for the Option group (eg. 10) Get the Option value of the Option button selected (eg. 1) Get the tab index number for the tab inside the Tab Control But I just found out, that the different tabs inside the tab control have no tab index numbers:-( So what's next? You're being confused by the similarity between "tab index" and "page index" on the one hand, and "tab index" and "tab control" or "tab page", on the other. It's not actually the Tab Index property that you're interested in at all, but the Page Index property of the tab control's pages. If you built your option group using the Option Group Wizard, and let it pick the option values, it will have assigned them values in sequence -- 1, 2, 3, and so on. The Page Index properties of a tab control, by contrast, are numbered sequentially starting at 0 -- 0, 1, 2, and so on. The simplest way to have your tab control pages correspond to the options of the option groupc is to have page 0 correspond to option 1, page 1 correspond to option 2, and so on. That way all you have to do is set the tab control's value to the (option group value - 1). Let me give you some example code. This code will use the following "invented names" for your controls: optMyOptionGroup - the option group frame whose value you want to use to determine which page is shown on the tab control. tabMyTabControl - the tab control you want to control. To change pages on the tab control when the option group is updated, you might have an event procedure for the option group like this: Private Sub optMyOptionGroup_AfterUpdate() Me.tabMyTabControl = Me.optMyOptionGroup - 1 End Sub To make sure that the tab control shows the correct page as you move from record to record, you would repeat the central line of code from the above procedure in an event procedure for the form's Current event: Private Sub Form_Current() Me.tabMyTabControl = Me.optMyOptionGroup - 1 End Sub And that would be all you need, in this ideal case. If the relationship between the option chosen and the specific tab page is more complicated than that, you would need slightly more elaborate code than that. Let me know if that's the case, and if you need help with it. -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) . . |
#7
|
|||
|
|||
Option buttons and tabs
"Aniko" wrote in message
Hi Dirk, I do not exactly know what happened, but the problem you originally helped me with, came back. After everything worked well in the original form, where I designed tabs and inserted sub forms, I decided to design the switchboard. I tried to set up the switchboard few times, but even with only one button on it, which was meant to take me to the above mentioned form, did not work. Kept coming up with errors: "Error accessing file, network connection may have been lost." I decided to delete the switchboard and try again. No luck. Tried to create other form with command button to link to the form, no luck. And then I went back to the original form, and looked at the On Current Event Procedure and there is nothing there. I am unable to key in anything and getting the same error message when I try. Are you using Access 2000? It sounds like you've been bitten by a particularly nasty bug. See this KB article: http://support.microsoft.com/default.aspx?scid=kb;[LN];304548 Office 2000 SP3 fixes the bug, but that won't repair your corrupted database. You'll have to resort to a backup, or else try importing all objects to a new database -- some objects probably won't import, and you'll have to recreate them from scratch. When you do import the objects, unless you've applied the service pack, it is *crucial* that you compile and save the project before closing the database. -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) |
#8
|
|||
|
|||
Option buttons and tabs
Hi,
I spent 2 days trying to put the sp3 on Office 2000. I had all sorts of error messages. And did three installations unistallations :-( Now, according to the Office update site, I have the sp3, but I lost all the wizards. When trying to go to the switchboard manager I get this: Ms Access can't find the wizard or there or there is a syntax error in the Declarations section of the visual basic module. The error recommends the reinstallation, which I did, but no luck. It is getting most frustrating, Any idea where from there? Thanks Dirk, Aniko -----Original Message----- "Aniko" wrote in message Hi Dirk, I do not exactly know what happened, but the problem you originally helped me with, came back. After everything worked well in the original form, where I designed tabs and inserted sub forms, I decided to design the switchboard. I tried to set up the switchboard few times, but even with only one button on it, which was meant to take me to the above mentioned form, did not work. Kept coming up with errors: "Error accessing file, network connection may have been lost." I decided to delete the switchboard and try again. No luck. Tried to create other form with command button to link to the form, no luck. And then I went back to the original form, and looked at the On Current Event Procedure and there is nothing there. I am unable to key in anything and getting the same error message when I try. Are you using Access 2000? It sounds like you've been bitten by a particularly nasty bug. See this KB article: http://support.microsoft.com/default.aspx?scid=kb;[LN];304548 Office 2000 SP3 fixes the bug, but that won't repair your corrupted database. You'll have to resort to a backup, or else try importing all objects to a new database -- some objects probably won't import, and you'll have to recreate them from scratch. When you do import the objects, unless you've applied the service pack, it is *crucial* that you compile and save the project before closing the database. -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) . |
#9
|
|||
|
|||
Option buttons and tabs
wrote in message
Hi, I spent 2 days trying to put the sp3 on Office 2000. I had all sorts of error messages. And did three installations unistallations :-( Now, according to the Office update site, I have the sp3, but I lost all the wizards. When trying to go to the switchboard manager I get this: Ms Access can't find the wizard or there or there is a syntax error in the Declarations section of the visual basic module. The error recommends the reinstallation, which I did, but no luck. It is getting most frustrating, Any idea where from there? Huh, I didn't have any such problem when I applied SP3. If you haven't already, you might try removing the Acwztool.mde file and *then* running Repair, as directed in this KB article: http://support.microsoft.com/default...b;en-us;288300 ACC2000: "Microsoft Access Can't Find the Wizard..." Error Message After You Apply the Access 2000 and SQL Server 2000 Readiness Update As the title indicates, the article is addressing a problem that arises from a different series of events, but following the steps set forth in the article's "Resolution" section may still help. I'd say it's worth a try. Let me know how it goes, please. -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) |
#10
|
|||
|
|||
Option buttons and tabs
Hi Dirk,
Thank you for your reply. The file, which was mentioned in the article was already renamed as directed by another article which recommended to rename 3 files (Acwx*.mde) to *.old before Sp-3 is installed. Which I did and now when looked for the acwztool.mde file, there were no new files created with the *.mde extension. Only the *.old was there. Still I cut I paste all these files away from the original folder, and ran the repair. The repair had many error messages, saying "Error 1328. Error applying patch to file c:\Config.msi\*.tmp. I clicked Ignore for these. After the repair I still had the same error when trying to open the switchboard manager. And the files were not recreated in the original folder. I searched the CD for these files and simply copied them to the original folder. Now there is no error message when accessing the switchboard manager, but I still have the very first error with the original database (Error accessing file...). I recreated the form in a new database (the one with the option buttons and tabs) by importing the original tables. It works fine, however, when adding the switchboard, I can fill in the necessary information for the switchboard, and click Close, and there is no Switchboard item in the Forms object only in the table object and cannot see it when setting up the Startup option. I just don't know what I am doing wrong. Thanks for your help, Aniko On the other hand, I recreated -----Original Message----- wrote in message Hi, I spent 2 days trying to put the sp3 on Office 2000. I had all sorts of error messages. And did three installations unistallations :-( Now, according to the Office update site, I have the sp3, but I lost all the wizards. When trying to go to the switchboard manager I get this: Ms Access can't find the wizard or there or there is a syntax error in the Declarations section of the visual basic module. The error recommends the reinstallation, which I did, but no luck. It is getting most frustrating, Any idea where from there? Huh, I didn't have any such problem when I applied SP3. If you haven't already, you might try removing the Acwztool.mde file and *then* running Repair, as directed in this KB article: http://support.microsoft.com/default...b;en-us;288300 ACC2000: "Microsoft Access Can't Find the Wizard..." Error Message After You Apply the Access 2000 and SQL Server 2000 Readiness Update As the title indicates, the article is addressing a problem that arises from a different series of events, but following the steps set forth in the article's "Resolution" section may still help. I'd say it's worth a try. Let me know how it goes, please. -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) . |
|
Thread Tools | |
Display Modes | |
|
|