The setup:
I have a Form that is attached to a Table.
I can enter information into the form and then go look at the table and see that the information is there (this is while the form is open).
When I close the form, I can go look at the table and see the information is still there. For example (note that this table has 82 fields in it, only 3 are being shown for reference):
Here is the problem:
When I open the form up, it shows no records. I open up the table, and it shows another line above the original records. For example:
My thought is that there is an EOF in there after the top record...here is why.
There is a routine that I run onLoad of the form:
Private Sub CleanupDB()
Dim RecClone As DAO.Recordset
Dim x As String
On Error GoTo exit_CleanupDB
Set RecClone = Me.RecordsetClone
RecClone.MoveFirst
Do Until RecClone.EOF
If RecClone("Name") = "" Or IsNull(RecClone("name")) Or RecClone("ticket_number") = "" Then
RecClone.Delete
End If
RecClone.MoveNext
Loop
RecClone.Close
Set RecClone = Nothing
'DoCmd.GoToRecord , , acLast, 1
Me.Form.Refresh
exit_CleanupDB:
End Sub
When it runs (and it doesn't make a difference whether or not it is ran, it still shows the same table info) it will go to the Do....Until and drop into it with the topmost record. It will run the procedure on it, then go to the Loop line and swing back up into the Do Until EOF. Then it drops out of the loop like it found an EOF and finishes the routine. It never scans through the other records in it.
Why is this? Help me please.
Thanks
I have a Form that is attached to a Table.
I can enter information into the form and then go look at the table and see that the information is there (this is while the form is open).
When I close the form, I can go look at the table and see the information is still there. For example (note that this table has 82 fields in it, only 3 are being shown for reference):
Book1 | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | Job_Number | Name | Ticket_Number | |||
2 | 1 | John | 1 | |||
3 | 2 | Mary | 2 | |||
4 | 3 | Tom | 3 | |||
Sheet1 |
Here is the problem:
When I open the form up, it shows no records. I open up the table, and it shows another line above the original records. For example:
Book1 | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | Job_Number | Name | Ticket_Number | |||
2 | ||||||
3 | 1 | John | 1 | |||
4 | 2 | Mary | 2 | |||
5 | 3 | Tom | 3 | |||
Sheet1 |
My thought is that there is an EOF in there after the top record...here is why.
There is a routine that I run onLoad of the form:
Private Sub CleanupDB()
Dim RecClone As DAO.Recordset
Dim x As String
On Error GoTo exit_CleanupDB
Set RecClone = Me.RecordsetClone
RecClone.MoveFirst
Do Until RecClone.EOF
If RecClone("Name") = "" Or IsNull(RecClone("name")) Or RecClone("ticket_number") = "" Then
RecClone.Delete
End If
RecClone.MoveNext
Loop
RecClone.Close
Set RecClone = Nothing
'DoCmd.GoToRecord , , acLast, 1
Me.Form.Refresh
exit_CleanupDB:
End Sub
When it runs (and it doesn't make a difference whether or not it is ran, it still shows the same table info) it will go to the Do....Until and drop into it with the topmost record. It will run the procedure on it, then go to the Loop line and swing back up into the Do Until EOF. Then it drops out of the loop like it found an EOF and finishes the routine. It never scans through the other records in it.
Why is this? Help me please.
Thanks