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

Combo Box Selector Won't Work with Date Field

Status
Not open for further replies.

inaxcess

Technical User
Aug 26, 2002
3
US
MS97/Win98. I set up combo boxes based on text fields in my database so that I can "find and display" the record selected in the combo box. They work fine for the text fields, but I can't get the combo box for date field to work. It seems like the combo box is "seeing the database" in some way, because if I navigate the middle of the database, then use the combo box, the data cycles back to the first record (regardless of the combo box input). I checked that the form and combo box have the correct sources. Any other ideas? I'm non-SQL - please respond in terms of the Combo Box Properties. Thanks.
 
I'm assuming then that you used the Wizard to create the find/display combo box.

The combo box that you have for the date field should be set to Row Source Type = Table/Query, right? What is your Row Source property set to? It should be set to the column in either the table or query that you're using to display the date. If you used the wizard, did you move the date field from the left side to the right to include it in the find/display combo?

I have a date object on a form that has a control source back to the table that has the date/time type and it works fine on a find/display combo box. I did, however, start with it as a text box and then just changed it to a combo box and it worked fine. Adding the proper row source, the data displayed properly.

Check the Row Source Type and Row Source properties to make sure the data is displayed in the box properly. Then you might want to run through the wizard again to make sure you selected the date field when the combo box is created.

DreamerZ
 
Thanks DreamerZ. I double-checked the properties as you suggested, and everything was set the way it was supposed to be. So, scrapped everything and recreated the base query, form and combo box - and still no luck. Here is some more info, to see if you spot an error.

I first create the new "select by date" form by copying/renaming a similar form (let's call it "select by customer name") that has a working combo box. Then I change the new form's Record Source to from the "sort by ascending customer" query to the "sort by ascending date" query. Then I then delete the "customer name" combo box and create a new "date combo box" through the wizard.

The four times I've followed this process with date fields has resulted in working forms. What is weird is that if I open the "date select" form, use the navigator buttons to "toggle" through the database, and then do the date selection in the combo box, the pointer always moves back to the first record - regardless of what date is selected in the combo box. So it seems to "see" the combo box results, but doesn't take the correct action on the database.

As another angle, I also created an entirely new table with two fields (one date, one text), and created a date-sort query, a new form and a date combo box. Same results! So, it doesn't seem like something unique to my table. Any other ideas? Thanks.
 
Sounds really odd. Unless someone else has any suggestions, can you send me a stripped version of your database that I can look at? Stripped meaning none or very few records in the table.

Here's my e-mail: cm1628@sbc.com

DreamerZ
 
Did you change the field type in your modified dataase to date? And which Date type. Check out the mask.

rollie@bwsys.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top