Copy Button help needed

B

Ben

I have a button on a form that will copy the last entry for all the fields on
the form and make a duplicate. At the top of the form, I have a drop down
menu that displays dates. When I click the Copy Records button I created,
the data gets copied and then I have to select the date on the drop down
menu. Is there a way that when I click the Copy Records button that it also
selects the last date in the drop down menu automatically?

Ben
 
J

Jeanette Cunningham

Hi Ben,
someone may have a better idea, but here is one way.
You can count the no of items in a drop down list.
Use Me.NameOfCombo.ListCount
The list count is zero based - the first line is counted as 0.
If the combo displays a header, the header is counted as row 0.

To set a combo to a specific value from its list you can use
Me.NameOfCombo = Me.ItemData(N)

ItemData finds the value for the nth value of the list.
If you want the 2nd number, use 2 instead of N.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top