Change Textbox to Combobox

waq963

Registered User.
Local time
Today, 01:30
Joined
Jan 27, 2009
Messages
84
Hi, I would like to change a textbox into a combobox when checking a checkbox? Thanks
 
I think the only way you can do that is to have both a combo box and text box on your form and change which one is visible as needs be.

Something like the following in the Yes/No's On click event should do the trick
Code:
If Me.YourYesNo = True Then
     Me.YourCombo.Visible = True
     Me.YourText.Visible = False
Else
     Me.YourCombo.Visible = False
     Me.YourText.Visible = True
End If
 
Good Idea, nice and easy. Cheers Mate. While i have yout attention do you know how to set a textbox to always allow a value that is less than another. E.g. txtScore is always less than txtMaxScore? Thanks
 
You could do a test in the Before Update event.

It might look something like;

Code:
If Me.txtScore.Value > Me.txtMaxScore.Value Then
        MsgBox "please enter a lower value"
        Cancel = True  [COLOR="Green"]' causes the changes to not be saved[/COLOR]
        Undo  [COLOR="Green"]' Resets the value of txtScore[/COLOR]
End If
 

Users who are viewing this thread

Back
Top Bottom