My guess the best option would be to put them in 1 frame so you select either one of them. Otherwise you should put an extra button to enable both frames when you change your mind.
My guess the best option would be to put them in 1 frame so you select either one of them. Otherwise you should put an extra button to enable both frames when you change your mind.
or give them the same 'groupname'
Thanks
I did have a version where I placed all in the 1 frame...I am stilling working on it but it does work on some features.The issues I am having is if I select Internal and its selections from the combobox`s it works as it renders External combobox`s disabled.If i then change to External is keeps the selections in the combobox`s also from Internal so it ends up transferring both Internal and External combobox`s......if I select Internal and its combobox`s only it works fine......same for External
I also have userform Production and Planned Stop now working
How do I give the same Groupname.....is this in properties?
Thanks
Combobox issue resolved.
Thanks bakerman
Works....if i select Internal or External can the Time textbox`s also be disabled (entry deleted) on the 1 not selected.
If changing from say Internal to External it removes the entries in the Combobox`s but not the Textbox.......i will attempt to resolve this so would i need to add code in the Optionbutton4 and 5 parts of the code
Thanks again
Try it this way.
Code:Private Sub OptionButton4_Click() For i = 2 To 6 With Me("Combobox" & i) .Value = vbNullString .Enabled = IIf(i <= 4, True, False) End With If i = 2 Or i = 3 Then With Me("Textbox" & i) .Text = vbNullString .Enabled = IIf(i = 2, True, False) End With End If Next End Sub Private Sub OptionButton5_Click() For i = 2 To 6 With Me("Combobox" & i) .Value = vbNullString .Enabled = IIf(i <= 4, False, True) End With If i = 2 Or i = 3 Then With Me("Textbox" & i) .Text = vbNullString .Enabled = IIf(i <> 3, False, True) End With End If Next End Sub
Thanks for all your help bakerman...the code above worked
I did find 2 errors...i used the Tag property in the userform for the Combobox`s and Textbox`s and they work...i used the Tag Property for the Optionbuttons for XFLOW A+B+C also but if i transfer the userform without selecting XFLOW A or B or C it gives a Runtime error...i thought the Tag property would stop this error...
Also if i do not select External or Internal i can then select all the Combobox`s and Textbox`s in the frame......is there a way to force either Internal or External to be selected
Thanks
Paul
Last edited by paul_pearson; 09-04-2013 at 04:06 PM.
1) Remove the Tags from XFLOW A+B+C and put next code on top of CommandButton1_Click.
2) In designmode set the Enabled-property of the CB's and both TB's to False.Code:For Each ctl In Frame1.Controls If TypeName(ctl) = "OptionButton" Then If ctl.Value = False Then x = x + 1 End If Next If x = 3 Then MsgBox "Select a machine before you write data": Exit Sub
Thanks bakerman
Added the code (possibly in the wrong place) and set the Enabled-property of the CB's and both TB's to False
If i select date and machine and press Transfer Button it messagebox says "Select a Part"...i press OK and it give a Runtime Error 2110.....
Could this be where i placed the code as you mentioned on top of CommandButton1_Click...i could not get it to place above the CommandButton1_Click which may cause the error
Thanks again
Change this line
to this lineCode:If ctl.Value = vbNullString Then MsgBox ctl.Tag: ctl.SetFocus: Exit Sub
The error occured because you can't set focus to a disabled object.Code:If ctl.Value = vbNullString Then MsgBox ctl.Tag: Exit Sub
Bookmarks