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

Reset Auto Number

Status
Not open for further replies.

jewilson2

Technical User
Feb 7, 2002
71
US
Hello all.

I have a table where the records are set to autonumber. There is a form built that references that table. The problem is, when records are deleted from that table, the auto number doesn't resequence. Then the form that references that table shows blank lines where the deleted records use to be. For example...say i have 10 records in the table, and delete the first 5. When viewing the 'drop down' from the form, it will show 5 blank records, then the 5 remaining records (6-10). Any way to resequence these so that the deleted records don't show up as blanks?

Thanks in advance
 
You don't want to resequence the auto number field.

I think what you need is to requery your drop down control.

Try this, on the form activate event

combo0.requery
 
thanks for the reply, but I'm not sure I follow your suggestion. Is this code something I would insert on the form, or on that particular pull down menu box? Where is it inserted.

Thanks again....
 
Adding to mndrlion's suggestion

You want to requery the combo box just after you delete the records from the table to which the combo is bound. That causes the recordset that is supplying data to the combo to go back to the database and get a revised copy of the data which now doesn't contain the deleted records.
 
Well...I think I see where you're talking about adding it.

Form, Properties, Event, onActivate. Then I built an expression to say Call_Log (which is the name of the drop down box) .requery

looks like Call_Log.requery, but doesn't do anything.
 
at

Form, Properties, Event, onActivate

select [Event Procedure]. Then click on the ... button to the right. Enter the expression there.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top