Getting Unwanted Additional Records In Form Details

T

tsluu

On form load I am setting form recordsource to a SQL statement. My problem is
when I update a rowsource of a listbox in the form details, an additional
record appears in the form details. That is highly unusual since based on the
SQL statement, there should be no records. There are however several records
in the listbox. Could there be a linkage that caused the extra records in the
form details?
 
J

John W. Vinson

On form load I am setting form recordsource to a SQL statement. My problem is
when I update a rowsource of a listbox in the form details, an additional
record appears in the form details. That is highly unusual since based on the
SQL statement, there should be no records. There are however several records
in the listbox. Could there be a linkage that caused the extra records in the
form details?

A subform will display a blank, empty, not-yet-existant new record for an
updateable form. Is that what you're seeing?

If not, please post the SQL statement and indicate what's appearing and when.
 
T

tsluu

The not-yet-existent new record for an updateable form is fine but when the
code runs the indicated line below, an extra record appears. So I am seeing
two records.

With Me.cboProject
.BoundColumn = 1
.ColumnCount = 3
.ColumnWidths = "800;1500;0"
.RowSource = ssql
.ListWidth = 2300
.ListRows = 5
---> .Value = .Column(0, 0)
End With
 
J

John W. Vinson

The not-yet-existent new record for an updateable form is fine but when the
code runs the indicated line below, an extra record appears. So I am seeing
two records.

With Me.cboProject
.BoundColumn = 1
.ColumnCount = 3
.ColumnWidths = "800;1500;0"
.RowSource = ssql
.ListWidth = 2300
.ListRows = 5
---> .Value = .Column(0, 0)
End With

Well... yes. You're dirtying the record by setting the bound combo's Value; so
you now have the newly entered, active record and a "new new" record. It's
doing precisely what you're asking it to do.
 

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