Listbox Not Working Properly

Rebel7

Registered User.
Local time
Today, 08:31
Joined
Feb 17, 2009
Messages
23
Hi Guys,

I have a form with textboxes that the user manually enters information in and submits the information to a database table in access with the click of a button. The listbox is to display a list of SINs for that day that need to have information entered on the form. However, I have encountered a few problems that I cannot seem to figure out.

The list box is set to run off a query and display the results. The query gives the most recent record of any SIN older than today and has "update" in the status column. These SINs with "update" are the ones that the user needs to see in the listbox so he can enter the new information in the textboxes and submit that to the database. The problem is anytime I click on the listbox and then click on the textbox and enter the values in the textboxes and hit the submit button, when I go the the table, the values are all entered in the table except there is no date entered in the date column. The date column of the table is automatic and is set to =Now() so that any record entered will have the current time attached to it.

It works fine when I enter the data in the textboxes and do not click on the list box at all. The reason for clicking on the listbox is that I have it set to automatically populate the SIN textbox with the SIN value clicked on in the listbox to avoid errors with entering the wrong SIN. But I need to have the date also populate when I click on the list box and then enter values in the textboxes and click submit.

Any help you can give is appreciated.
 
It seams to me that you are actually updating a table at this point not adding to it. As the data is in a table somewhere in order to be able to retreive it and populate the list box.

You may want one field for the date added set to Now() and another field named last updated that is updated to now() each time that record is updated. To do this simply treat is as another field and use Now() as the default value.

David
 
Hi DCrake,

The data entered in the textboxes is actually being added to the table and not updating the records in the table The reason is because I want to keep all the records that were entered and add to those records rather than update them. The status update simply means that they need to have a new record added to the table.

Sorry for not being clear.
 

Users who are viewing this thread

Back
Top Bottom