How to refresh a subform' records

D

Dou

After I have deleted a record on the subform. I can't show other records.
How to refresh it and can show other records.

thanks
 
O

Ofer

if you delete the record using a button on the main form then the right
syntax will be me.subformname.requery

if you delete by selecting a record and then press delete then it should do
the requery for you.
if the requery doesnt help you then explain how you trying to delete.
 
D

Dou

Like this:

With Me![OrderAddSubform].Form
If .NewRecord Then
Beep
Else
.RecordsetClone.Bookmark = .Bookmark
.RecordsetClone.Delete
Me![OrderAddSubform].Requery
End If
End With

After execute these code, can delete the selected record, but other record
cann't be shown.
 
O

Ofer

I see you had that post before, if your mdb is small try and mail it to
[email protected]

I'll have a look

Dou said:
Like this:

With Me![OrderAddSubform].Form
If .NewRecord Then
Beep
Else
.RecordsetClone.Bookmark = .Bookmark
.RecordsetClone.Delete
Me![OrderAddSubform].Requery
End If
End With

After execute these code, can delete the selected record, but other record
cann't be shown.



Ofer said:
if you delete the record using a button on the main form then the right
syntax will be me.subformname.requery

if you delete by selecting a record and then press delete then it should do
the requery for you.
if the requery doesnt help you then explain how you trying to delete.
 
D

Dou

I have solved this problem. thanks.

Ofer said:
I see you had that post before, if your mdb is small try and mail it to
[email protected]

I'll have a look

Dou said:
Like this:

With Me![OrderAddSubform].Form
If .NewRecord Then
Beep
Else
.RecordsetClone.Bookmark = .Bookmark
.RecordsetClone.Delete
Me![OrderAddSubform].Requery
End If
End With

After execute these code, can delete the selected record, but other record
cann't be shown.



Ofer said:
if you delete the record using a button on the main form then the right
syntax will be me.subformname.requery

if you delete by selecting a record and then press delete then it
should
do
the requery for you.
if the requery doesnt help you then explain how you trying to delete.

:

After I have deleted a record on the subform. I can't show other records.
How to refresh it and can show other records.

thanks
 
Top