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!

Combo Box Default Value 1

Status
Not open for further replies.

rbehnke

Technical User
Jul 20, 2007
20
US
I was working to change the functionality of a form by adding a list box that was unrelated to another combo box. The combo box has (had) a default value that I had entered in the Default Value field in Properties as "[cboType].[ItemData](0)". All of a sudden, this combo box no longer displays a default value when I open the form.

There is no other code that sets this value upon opening the form.

What have I done??? Any ideas???

Thanks so much.
 
Did you accidentally set both fields control source or record source to the same table/field/value? Try messing with those properties to see if any change..

--

"If to err is human, then I must be some kind of human!" -Me
 
Control Source is blank.

This is a Value List with the following:

"Group";"G";"Individual";"I"

I want "Group" to be the default.

I am working in my "Development" file and have messed this up . . . . it still works fine in the Production version . . . . until I promote the Development file . . . .

Thanks again.
 
There's got to be some other difference between the 2 than just one having a list box, and the other not.

If you need to open a copy of the production version, and it's being used by someone else, you can do so this way:

copy/paste or <ctrl> + drag the file to another location.. if you hold down the <ctrl> button while dragging, it'll create a copy, same as copy/paste. Then you can open that copy of the production database - just be sure to name it so you know it isn't really the "live" copy...

then you can compare the 2 databases to be sure what the difference(s) might be..

--

"If to err is human, then I must be some kind of human!" -Me
 
I compared the property boxes of the two versions and found no differences.

Specifically what I did was replace a combo box with a new list box on the form. The old combo box was and the new list box is the field before (tab order) the combo box I am having trouble with.

I didn't really touch the combo box. All of a sudden, the default value stopped appearing when I open the form.

Could my form be corrupted?

Thanks.
 
Well, it's worth a try, I suppose, to make a copy of the original as a new development copy, make the same change again, and see... that's the only way to know on that for sure, I guess.

Otherwise, [pc]

--

"If to err is human, then I must be some kind of human!" -Me
 
I opened both Development and Production and compared. No differences in the properties of the combo box.

I imported Production form, deleted old combo box and replaced with new list box. I copied new code over the old code so that this form would function same as the one I was revising.

Same problem.

As soon as I delete the old combo box and put the new list box in, the default value in the combo box disappears.
 
I found that the Row Source of the New List box makes the default value of the remaining combo box disappear. Go figure. The same Row Source of the old combo box works fine with the other combo box, but when the combo box changes to a list box and uses the same Row Source, no go.

I removed the Default Value from the remaining combo box and am setting the initial (default) value of the remaining combo box from code as the form opens.
 
Well, glad you got it working - bailing wire and duct tape or not! [wink]

'Course, duct tape sure is a good thing!

Thanks for letting us know what worked.

--

"If to err is human, then I must be some kind of human!" -Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top