Storing values from listbox

A

Asif

I have a listbox (lst_Cables) which holds date and quantity of all the
entries made. I also have a textbox (txt_Start) this textbox displays
the date of the last entry in the lst_Cables. When the listbox is
cleared the date value in txt_Start remains however when the form is
closed and then re-opend the value in txt_Start is gone and an error
message appears instead. I'm assuming this occurs because the listbox
is empty and the default value of the textbox resets itself.

What I want to do is somehow to store the date value displayed in the
textbox (txt_start) so that when I re-open the form I can see the date
of the last entry of the listbox before it was erased. Any suggestions

Thanks
 
A

Asif

I'm a little confused...

You want a textbox on your form to show a date of something that was
deleted? If so, you'll need to store that date in some field.

--
Regards

Jeff Boyce
Microsoft Office/Access MVPhttp://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentorhttp://microsoftitacademy.com/

Microsoft Registered Partnerhttps://partner.microsoft.com/


Yes thats correct but the textbox picks up the last entry date and
stores it as a default value only untill the form is open hence your
right I'd have to store the value of the textbox in a field. Would
that require me creating another table for storing this value or how
else can i go about it??

Thanks
 
J

Jeff Boyce

I know nothing about the table structure you have, so I have no idea where
(aside from in a table).

If you have deleted the values from the listbox (and from the underlying
table), you won't have a way to calculate the "last" one. Are you actually
deleting values from tables?

Yes, one approach would be to have a table that stores only the last value.

Another approach would be to use an "init" text file outside of Access to
which Access refers to get that value.

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/
 

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

Similar Threads

Listbox listcount 7
Listbox and Textbox 1
Requery listbox 1
Listbox search question 4
Requery Issue 2
Textbox, Date Function 1
Search Listbox vs Table Query 1
Split form 0

Top