Re: Closing a form automatically if no records




"Thelma Lubkin" <thelma@xxxxxxxxxxxxxxxxxx> schreef in bericht news:dsacbl$79i$1@xxxxxxxxxx
Arno R <arraNOcomSPAM@xxxxxxxxxx> wrote:
: Private Sub Form_Load()
: If Me.RecordsetClone.RecordCount = 0 Then
^^^^^
why isn't Recordset itself good enough here?
--thelma
: MsgBox "No records.."
: DoCmd.Close
: End If
: End Sub

: Arno R

I guess one an use Me.Recordset also, but I see this property is only available with Access2k or better.
I am used to use Recordsetclone, but it was in the Access 2.0 days that I learned about that ...

Arno R
.



Relevant Pages

  • RE: New Login questiion
    ... I do seem to be getting a type mismatch error around to "Set RS" code. ... Private Sub tbBadge_AfterUpdate ... MsgBox "You must enter a Badge Number", vbOKOnly, "Required ... 'now open the recordset ...
    (microsoft.public.access.formscoding)
  • RE: New Login questiion
    ... "John Petty" wrote: ... Private Sub tbBadge_AfterUpdate ... MsgBox "You must enter a Badge Number", vbOKOnly, "Required ... 'now open the recordset ...
    (microsoft.public.access.formscoding)
  • Error 429 when opening a disconnected recordset
    ... The following code creates and opens a disconnected ADODB.Recordset. ... Private Sub pTest1() ... Dim rs As Recordset ... MsgBox Err.Description & vbCrLf & Err.Number, ...
    (microsoft.public.data.ado)
  • Error 429 when opening a disconnected recordset
    ... The following code creates and opens a disconnected recordset. ... This has happend on Win ME and on Win XP. ... Private Sub pTest1() ... MsgBox Err.Description & vbCrLf & Err.Number, ...
    (microsoft.public.vb.database.ado)
  • Re: Closing a form automatically if no records
    ... Arno R wrote: ... : Private Sub Form_Load ... why isn't Recordset itself good enough here? ... : MsgBox "No records.." ...
    (comp.databases.ms-access)