Default value for a Combo Box

HeatherE

New member
Local time
Today, 18:11
Joined
Dec 6, 2001
Messages
8
I'm currently using the Order Entry DB and am having a problem setting a default value for the EmployeeID field in the frmOrders. The user only has one employee that sells tickets and would like to be able to have that employee's name automatically appear in the combo box each time she enters the frm Orders. Can anyone tell me how to accomplish this?
 
You can put the name in the Default Value property of the Combo box.
 
I've tried to do that, but it won't stay in the box after I close the form and open it again. The value is still in the Default Value in the properties box, but the value doesn't appear in the form.

Any ideas?
 
go into the code builder and on formload type:

controlname = "enter defaut value here"

I think that should do it?
 
No, still doesnt' seem to be working. Maybe I'm doing something wrong here? I thought it would be an easy problem to fix, but I can't seem to get the value to stay once I reload the form. Does anyone have anything else I can try?
 
Make sure that you have the default property of the ComboBox set and then in the Form's On_Open event, put the code:

cmbYourComboBoxName.Requery

(remember to substitute the actual name of your combo box)

BL
hth
 
The default value will only be stored/displayed when adding new records, are you saying that the record is not being saved after adding a record or is just not being displayed when you first open the form to add a record?
 

Users who are viewing this thread

Back
Top Bottom