If Me.NewRecord = True Then
Me.cmbCNum.Locked = False
Me.cmbSNum.Locked = False
Me.cmbCNum.Enabled = True
Me.cmbSNum.Enabled = True
If Me.cmbCNum.ControlType = acTextBox Then
Me.cmbCNum.SetFocus
DoCmd.RunCommand acCmdChangeToComboBox
End If
If Me.cmbSNum.ControlType = acTextBox Then
Me.cmbSNum.SetFocus
DoCmd.RunCommand acCmdChangeToComboBox
End If
Else
If Me.cmbCNum.ControlType = acComboBox Then
Me.cmbSNum.SetFocus
DoCmd.RunCommand acCmdChangeToTextBox
End If
If Me.cmbSNum.ControlType = acComboBox Then
Me.cmbSNum.SetFocus
DoCmd.RunCommand acCmdChangeToTextBox
End If
Me.cmbCNum.Locked = True
Me.cmbSNum.Locked = True
Me.cmbCNum.Enabled = False
Me.cmbSNum.Enabled = False
End If
What I want to do is change the combo box to a text box, and vice versa, depending if the form is on a new record or not. The rest of the code works, but the part for changing the type of box doesn't. It doesn't work if I use, for example,
If Me.cmbSNum.ControlType = acComboBox Then
Me.cmbSNum.ControlType = acTextBox
End If
either.
Help?
Allow Design Changes is set to all views.