dss28
Board Regular
- Joined
- Sep 3, 2020
- Messages
- 165
- Office Version
- 2007
- Platform
- Windows
i have a user form with three options for printing a form.
The user selects the format by choosing option button 1 or 2 or 3. it opens another userform "frmMEDForm"to fill various details.
if opt button 1 is selected, it changes one combo box in the "frmMEDForm" to choose 1 to 12 Sr. No. to fill upto 12 lines with 70 character limit, hides two of the three command buttons and displays only one required to print the form.
if opt button 2 is selected, it changes the same combo box to choose 1 to 6 Sr. No. to fill upto 6 lines with 200 character limit, ...
if opt button 3 is selected, it changes the same combo box to choose only one Sr. No. to fill 1 lines with 600 character limit, ...
every other aspect is working fine but just the combo box working...
After selecting opt button 1 first, combo box is empty , however it should show sr no. 1 to 12
Then if opt button 2 is selected, combo box shows 1 to 12 Sr No. but it should show 1 to 6 SrNo.
Then if option button 3 is selected it shows, 1 to 6 Sr No. and not just 1 Sr No. as it should be and so on.....
Some line to reset the combo box is missing but I dont know where to place it.
Request please guide to resolve.
the code is as follows:
The user selects the format by choosing option button 1 or 2 or 3. it opens another userform "frmMEDForm"to fill various details.
if opt button 1 is selected, it changes one combo box in the "frmMEDForm" to choose 1 to 12 Sr. No. to fill upto 12 lines with 70 character limit, hides two of the three command buttons and displays only one required to print the form.
if opt button 2 is selected, it changes the same combo box to choose 1 to 6 Sr. No. to fill upto 6 lines with 200 character limit, ...
if opt button 3 is selected, it changes the same combo box to choose only one Sr. No. to fill 1 lines with 600 character limit, ...
every other aspect is working fine but just the combo box working...
After selecting opt button 1 first, combo box is empty , however it should show sr no. 1 to 12
Then if opt button 2 is selected, combo box shows 1 to 12 Sr No. but it should show 1 to 6 SrNo.
Then if option button 3 is selected it shows, 1 to 6 Sr No. and not just 1 Sr No. as it should be and so on.....
Some line to reset the combo box is missing but I dont know where to place it.
Request please guide to resolve.
the code is as follows:
VBA Code:
Private Sub opt1_Click()
If opt1.Value = True Then
frmMEDForm.txbDescription.MaxLength = 70
End If
frmMEDForm.cmdFinalizeXL.Visible = True
frmMEDForm.cmdFinalize.Visible = False
frmMEDForm.cmdFinalizeS.Visible = False
frmMEDForm.Show
With frmMEDForm.cmbSrNo
.AddItem "1"
.AddItem "2"
.AddItem "3"
.AddItem "4"
.AddItem "5"
.AddItem "6"
.AddItem "7"
.AddItem "8"
.AddItem "9"
.AddItem "10"
.AddItem "11"
.AddItem "12"
End With
End Sub
Private Sub opt2_Click()
If opt2.Value = True Then
frmMEDForm.txbDescription.MaxLength = 150
End If
frmMEDForm.cmdFinalize.Visible = True
frmMEDForm.cmdFinalizeXL.Visible = False
frmMEDForm.cmdFinalizeS.Visible = False
frmMEDForm.Show
With frmMEDForm.cmbSrNo
.AddItem "1"
.AddItem "2"
.AddItem "3"
.AddItem "4"
.AddItem "5"
.AddItem "6"
End With
End Sub
Private Sub opt3_Click()
If opt3.Value = True Then
frmMEDForm.txbDescription.MaxLength = 500
End If
frmMEDForm.cmdFinalizeS.Visible = True
frmMEDForm.cmdFinalizeXL.Visible = False
frmMEDForm.cmdFinalize.Visible = False
frmMEDForm.Show
With frmMEDForm.cmbSrNo
.AddItem "1"
End With
End Sub