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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lock ComboBox / keep pulldown accessible?

Status
Not open for further replies.

pmkieffe

Technical User
Jun 12, 2006
32
0
0
ID
Hi,

Thanks for any help.

I have a combo box in a subform. The box is populated by a query.

Is it possible to lock the combobox (to keep users from changing the source data value) but still allow the user to select a change in the combo box from the pulldown list?

As of now, the lock command disallows the user from typing over current data (which is good) but also disallow the user from selecting new data from the pulldown. Any help would be appreciated.


Thanks,
pmkieffe
 
Umm... So you want to limit the user to only selecting items in the list? Set the Limit to List property to "yes".

Ken S.
 
To prevent the user from entering data not in the lsit, select your combo box, and display its properties sheet. Try setting the Limit To List property to Yes. Are you trying to allow the user to enter new records in the form, but not allow edits of existing records?

Here's something from Access help:
Code:
AllowEdits Property
You can use the AllowEdits property to specify whether a user can edit saved records when using a form. Read/write Boolean.

expression.AllowEdits

expression   Required. An expression that returns one of the objects in the Applies To list.

Setting
The AllowEdits property uses the following settings.

Setting Visual Basic Description 
Yes True   (Default) The user can edit saved records. 
No False The user can't edit saved records. 


You can set the AllowEdits property by using the form's property sheet, a macro, or Visual Basic.

Remarks
You can use the AllowEdits property to prevent changes to existing data displayed by a form. If you want to prevent changes to data in a specific control, use the Enabled or Locked property.

If you want to prevent changes to existing records (make a form read-only), set the AllowAdditions, AllowDeletions, and AllowEdits properties to No. You can also make records read-only by setting the RecordsetType property to Snapshot.

When the AllowEdits property is set to No, the Delete Record and Data Entry menu commands aren't available for existing records. (They may still be available for new records if the AllowAdditions property is set to Yes.)

Changing a field value programmatically causes the current record to be editable, regardless of the AllowEdits property setting. If you want to prevent the user from making changes to a record (AllowEdits is No) that you need to edit programmatically, save the record after any programmatic changes; the AllowEdits property setting will be honored once again after any unsaved changes to the current record are saved.

Note   When the Data Mode argument of the OpenForm action is set, Microsoft Access will override a number of form property settings. If the Data Mode argument of the OpenForm action is set to Edit, Microsoft Access will open the form with the following property settings: 

AllowEdits — Yes 
AllowDeletions — Yes 
AllowAdditions — Yes 
DataEntry — No 
To prevent the OpenForm action from overriding any of these existing property settings, omit the Data Mode argument setting so that Microsoft Access will use the property settings defined by the form.

Tom

Live once die twice; live twice die once.
 
keep users from changing the source data value) but still allow the user to select a change in the combo box
Have a look at the AutoExpand and LimitToList properties of the ComboBox object.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top