Open data entry form without append

mgdemt

New member
Local time
Yesterday, 16:04
Joined
Jul 18, 2012
Messages
5
I have developed a database that tracks data from multiple facilitiies on a monthly basis. I made a form that uses a dropdown menu to select the facility and a command button to open the data entry form. Every time I open the data entry form, it adds a new blank record. How can I turn that off?
 
Welcome to the Forum,

What code are you using to open the form, and what code is used when the form has been opened, have you looked at the Events Tab in Design View for the form.
 
I believe I am using an embedded macro, but I am not a programmer. I have a simple form that uses a ComboBox lookup table with the list of locations from the main table and a comand button that opens the date entry form that is linked to a query. I added the following criteria to the location field in my query so that it would only present the locations selected; [forms]![DataEntry]![Location]
 
Is it actually adding a blank record or is it just presenting you the form with the fields blank instead of with the fields populated populated with a row from the source? If that's the case, look at the property sheet and set "Data Entry" to "No". This will cause your form to open populated with data instead of blanks.
 
Bryan, it is not opening with a blank record, but after I have performed updates, I print a report and it always includes a blank record that only has the location specified in the request.
 
Use "Is Not Null" in your report/query
 
Use "Is Not Null" in your report/query

Won't that just hide the bad rows from the query? The form will keep throwing the bad rows into the table(s).

I agree with rodme re macros. I don't use them. Try coding your command button using the vba DoCmd.OpenForm and see what happens.
 
If you have set a default value in the design of the table you will always get a new record with that default value set into the record.
 
When you are referring to a default value, I think the default value must be coming from the ComboBox where I select the location then. Maybe I should be using a filter of some sort to only display the location that I want to work with?
 
Won't that just hide the bad rows from the query? The form will keep throwing the bad rows into the table(s).

I agree with rodme re macros. I don't use them. Try coding your command button using the vba DoCmd.OpenForm and see what happens.

One would think you would want to fix anything that generates the bad records in the first instance anyway. Im not even sure what the OP means by blank records, if its the last line in a query for example that shows as blank, then I wouldnt call that a bad row, but again "is not null" wouldnt take that line out. If there is bad rows then the problem kinda lies in the design IMHO anyhow.
 
When you are referring to a default value, I think the default value must be coming from the ComboBox where I select the location then. Maybe I should be using a filter of some sort to only display the location that I want to work with?

Try this in the default value of the combo box. It should force it to open empty.

Code:
[cboSelect].[ItemData](0)
 
Bryan, where do I add that statement in the ComboBox?
 
Highlite the combo box. Find the Default Value field in the property sheet.
 

Users who are viewing this thread

Back
Top Bottom