G
Guest
Is there a way to change a combo box to a text box in VBA code?
what I want to do is use the same form for viewing/editing records in edit
mode (in which case I want combo boxes for a couple of the fields in order to
assist the user in finding the record they want faster), and also in add new
mode (in which case I only want text boxes, since the user will be adding new
data in these fields and does not have the need to look anything up in a
combo or list box)
I tried using:
Private Sub Form_Open(Cancel As Integer)
If Me.AllowAdditions = True Then
Me.cboLabName.ControlType = acTextBox
End If
End Sub
But I got the following error message: "To set this property open form in
report or design view"
Is there a way to do something like this in code?
Any ideas greatly appreciated, thanks.
what I want to do is use the same form for viewing/editing records in edit
mode (in which case I want combo boxes for a couple of the fields in order to
assist the user in finding the record they want faster), and also in add new
mode (in which case I only want text boxes, since the user will be adding new
data in these fields and does not have the need to look anything up in a
combo or list box)
I tried using:
Private Sub Form_Open(Cancel As Integer)
If Me.AllowAdditions = True Then
Me.cboLabName.ControlType = acTextBox
End If
End Sub
But I got the following error message: "To set this property open form in
report or design view"
Is there a way to do something like this in code?
Any ideas greatly appreciated, thanks.