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

Help With Entry of Empty Records

Status
Not open for further replies.

Ezyflo

Technical User
Aug 12, 2002
26
0
0
US
I have an input form that users can go and select data from a combo box and 2 fields where they can input data.

The problem I am having is that sometimes when users open the form and to enter data they click on the combo box and make their selection and then decides that they do not want to enter the data and clear it out. Access creates a record even though there is no data and I get these empty records in the database.

I have tried using the "required" property in the table, but that even creates more problems for the users, because when they clear it out, and try to do something else - Access error message keeps telling them that they must enter something in the field, and they are unable do anything else unless they enter data in the field.

Is there a way to set it so that it doesn't create a record if there is no data in the field and without having the error message of "required data" popping up?

Any help would greatly be appreciated.
 
Open the form in design view and go to the properties of the combo box. Remove any thing in the control source property it needs to be blank for this to work the way you want. Record creation should not start until an item is selected entered one of the two fields. If you also need to capture the combo box info to a new record then do it via an invisible field on the form that only populates after update of either of the other two fields.

Always look at it backwards, Sometimes it makes more sense
ssecca
 
Hi!

I tried what you suggested and cleared out the control source for the combo box. It made it an unbound control.

When I went in to select an item from the list box, it selected that item into every record that I had existing and also when I enter new records.

Let me explain my database/form a little more:

I have a table of containing employees and also a table for employee tasks.

On my form I have the main form of employeeid,employee, department etc. On my subform I have the task(the combo box), the "Fund Department" which is also a combo, a description data field and Percent of time data field. The 2 forms are linked by employeeid.

The user goes in, selects task from the combo box, selects the funding dept, enters the descrip/time for each task that they do.

I also have it where if the task is not in the list, I have a message box asking them if they want to add it and on the notinlist event have code to add it to the table list.

It seems to be working okay, right now - just that sometimes I get the empty records when the user enters and then clears out the record.

Thanking you in advance

Dee


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top