Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Locking Fields 2

Status
Not open for further replies.

lazarus

Technical User
Feb 27, 2001
3
US
How can I stop a fields contents from being altered after making a choice from a combo box. I don't really want to lock it, I just dont want the combo box to show any longert after the chioce is made.
 
Not really sure what you asking. Do you want to stop input into the combo box, or another field on your form? When you say you don't want it to show are you talking about the value that the combo box had? Or the combo box itself?

I'm gonna take a stab and say that you don't want the value that was selected in the combo box to show. If this is the case, in the combobox's AfterUpdate event you can put
ComboBoxName = " ". Again this is assuming that your combo box is not updating a field in an underlying table and is triggering code or a macro.

If this is not the case. Please give more detail.

B-) ljprodev@yahoo.com
Professional Development
MS Access Applications
 
Thanks for the help. You thought correctly on my question, however, the remedey does not work as advertised.
 
Dear Lonnie:
Thanks for this tip...I've been looking for the same remedy.

Dear Lazarus:
It works for me. (Rather than 'blank' the box, I wanted it to display "Enter or select".) Here's the code for the combo box that I used Lonnie's suggestion in:
Code:
Private Sub Combo361_AfterUpdate()
    ' Find the record that matches the control.
    Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.FindFirst "[AlphaSTREET] = '" & Me![Combo361] & "'"
    Me.Bookmark = rs.Bookmark
    Combo361 = "Enter or select"
End Sub
Good luck.
:) Gus Brunston
An old PICKer
padregus@home.com
 
Me Gus again:
I discovered that what I did above works o.k. when the souce of the combo box is type "text"; but if it's a number (e.g., integer) it doesn't work. Anyone know how I can display "Select a number" in a combo box that has a number for a source?
:cool: Gus Brunston
An old PICKer
padregus@home.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top