Re: RunCommand not working

From: Cheryl Fischer (cherylfischer_at_NOSPAMmsn.com)
Date: 05/08/04


Date: Sat, 8 May 2004 09:13:45 -0500

Instead of these:

> RunCommand acCmdRecordsGoToNew
> RunCommand acCmdRecordsGoToLast

try these:

          DoCmd.RunCommand acCmdRecords acCmdRecordsGoToNew
          DoCmd.RunCommand acCmdRecords acCmdRecordsGoToLast

hth,

--
Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX
"smk2" <anonymous@discussions.microsoft.com> wrote in message
news:9B5CBC17-07B2-4CD5-A0B5-78D970FC2BE7@microsoft.com...
> The following code has been working fine for weeks. The past couple of
days, I get an error "command 'RecordsGoToNew' isn't available now" when I
run this. I checked the enabled references and made sure that MS ActiveX
Data objects 2.8 is active which it is. I don't get a compile error with
this line. Any suggestions appreciated. Here is my code:
> The ">" is added to highlight the malfunctioning line.
>
>     With Me.frmPatPhoneSub.Form
>
>         .AllowAdditions = True
>         Me.frmPatPhoneSub.SetFocus
> >        RunCommand acCmdRecordsGoToNew
>
>         .PatientID = Me.PatientID
>         .PhoneID = InsertPhoneRecord()
>         Me.Dirty = False
>         .AllowAdditions = False
>         .Requery
>         RunCommand acCmdRecordsGoToLast
>
>     End With