Rx_
Nothing In Moderation
- Local time
- Today, 08:57
- Joined
- Oct 22, 2009
- Messages
- 2,803
A form uses a List Box that populates with a query. The query uses another forms ID that is selected. The record set (filterd by the ID) populates the list box. The records in the list box can be updated. It is possible to insert a new record in the list box, refresh the query and have it appear.
Problem - The query returns an empty recordset.
The record set recgonizes the field names, types. But, there are zero records. Try to insert a new record and it errors. And still shows zero recordcount.
Problem - The query returns an empty recordset.
The record set recgonizes the field names, types. But, there are zero records. Try to insert a new record and it errors. And still shows zero recordcount.
Code:
1300 Set rs = Me.Recordset
1340 rs.AddNew ' clears fields add any data, update - ID 99999 is just a place holder Field 0 is an autocounter
1350 Debug.Print "Record count is " & rs.RecordCount ' (zero returned) Debug.print rs.fields(1).name ' Yes the field is named "ID" 1360 rs.Fields("ID").Value = 99999
1370 rs.Update
1380 strAddNewRecordBookmark = rs.Bookmark