The command or action "PasteAppend" isn't available now?

H

Harmannus

Hallo,

When working in normal mode in my form i have a button to copy a record that
works with no problems:

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste
Append

But when i access the form through the switchboard i get a message: The
command or action "PasteAppend" isn't available now.

Anybody a suggestion what is the problem here?

I use the below code to disable the shift key. I already disabled the code
but still get the error message on coping a record.

ChangeProperty "StartupForm", dbText, "Switchboard" 'Change to name of
startupform
ChangeProperty "StartupShowDBWindow", dbBoolean, False
ChangeProperty "StartupShowStatusBar", dbBoolean, True
ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
ChangeProperty "AllowToolbarChanges", dbBoolean, False
ChangeProperty "AllowFullMenus", dbBoolean, False
ChangeProperty "AllowShortcutMenus", dbBoolean, False
ChangeProperty "AllowBreakIntoCode", dbBoolean, True
ChangeProperty "AllowSpecialKeys", dbBoolean, False
ChangeProperty "AllowBypassKey", dbBoolean, False

Regards,

Harmannus
 
A

Allen Browne

Instead of the antiquated DoMenuItem, try:
RunCommand acCmdSelectRecord
RunCommand acCmdCopy
RunCommand acCmdPasteAppend

The list of constants for RunCommand is not well documented, but Terry
Wickenden has a list at:
http://www.tkwickenden.clara.net/
 
H

Harmannus

Hallo,

Thanx for the suggestion. This has no effect.

What i fount is that [CurrentDb].[Properties]("AppTitle") causes the
problem!

Any suggestions why? Can i use an alternate method? I use this a lot for the
title of pop-up screens.


Regards,

Harmannus
 
A

Allen Browne

This is probably a reference issue. From any code window, choose References
from the Tools menu. Make sure you have a reference to:
Microsoft DAO 3.6 Library.
More information on references:
http://allenbrowne.com/ser-38.html

If the error is 3270, choose Startup from the Tools menu, and enter an
application title.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Harmannus said:
Hallo,

Thanx for the suggestion. This has no effect.

What i fount is that [CurrentDb].[Properties]("AppTitle") causes the
problem!

Any suggestions why? Can i use an alternate method? I use this a lot for the
title of pop-up screens.


Regards,

Harmannus


Allen Browne said:
Instead of the antiquated DoMenuItem, try:
RunCommand acCmdSelectRecord
RunCommand acCmdCopy
RunCommand acCmdPasteAppend

The list of constants for RunCommand is not well documented, but Terry
Wickenden has a list at:
http://www.tkwickenden.clara.net/

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

record
that
 
H

Harmannus

Hallo,

Thanx for the tip!

Solved it by using other code.

The problem was Dim DB As Database -> Set DB = CurrentDb
No i use Dim con As Object -> Set con =
Application.CurrentProject.Connection
But do i have to do other things now? Defining RS defirently? OR closing Con
and RS on my custom search form as the switchboard does? Not realy sure
here...



Part of search form code:

Con As Objext, rs As Object

Set con = Application.CurrentProject.Connection
Set rs = con.OpenRecordset("SELECT DISTINCTROW " & _
"tblMedewerker.MedewerkerID " & _
"FROM tblMedewerker" & _
" WHERE " & GetStrZoek & ";")
' If none found, then tell them and make me visible to try again
If rs.RecordCount = 0 Then
DoCmd.Hourglass False
MsgBox "Zoekactie levert geen resultaten op!", vbInformation,
[CurrentDb].[Properties]("AppTitle")
GetStrZoek = ""
Me.Visible = True
rs.Close
Exit Sub
End If
' Move to last row to get an accurate record count
rs.MoveLast
lngCount = rs.RecordCount
DoCmd.Hourglass False

Regards,

Harmannus


Allen Browne said:
This is probably a reference issue. From any code window, choose References
from the Tools menu. Make sure you have a reference to:
Microsoft DAO 3.6 Library.
More information on references:
http://allenbrowne.com/ser-38.html

If the error is 3270, choose Startup from the Tools menu, and enter an
application title.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Harmannus said:
Hallo,

Thanx for the suggestion. This has no effect.

What i fount is that [CurrentDb].[Properties]("AppTitle") causes the
problem!

Any suggestions why? Can i use an alternate method? I use this a lot for the
title of pop-up screens.


Regards,

Harmannus


Allen Browne said:
Instead of the antiquated DoMenuItem, try:
RunCommand acCmdSelectRecord
RunCommand acCmdCopy
RunCommand acCmdPasteAppend

The list of constants for RunCommand is not well documented, but Terry
Wickenden has a list at:
http://www.tkwickenden.clara.net/

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.


When working in normal mode in my form i have a button to copy a record
that
works with no problems:

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste
Append

But when i access the form through the switchboard i get a message: The
command or action "PasteAppend" isn't available now.

Anybody a suggestion what is the problem here?

I use the below code to disable the shift key. I already disabled
the
code
but still get the error message on coping a record.

ChangeProperty "StartupForm", dbText, "Switchboard" 'Change to
name
 
D

Douglas J. Steele

As I pointed out in response to your AllowBypassKey post, you're trying to
use DAO code, but you don't have a reference set to DAO.

After setting the reference as I explained in the other post, go back to
using Dim DB As Database, and setting it to CurrentDb, but change your
declaration from rs As Object to rs As DAO.Recordset. The problem you're
encountering is that Recordset is an object in both the ADO and DAO models.
Since you only have a reference to ADO, that's what you were getting before.

Actually, if you're not going to be using ADO, uncheck the reference to
Microsoft ActiveX Data Objects 2.1 Library when you add the reference to
DAO. That's because you'll need to disambiguate any of the objects which
occur in both models (like I did using DAO.Recordset above: the equivalent
to guarantee an ADO recordset would be ADODB.Recordset). The list of objects
with the same names in the 2 models is Connection, Error, Errors, Field,
Fields, Parameter, Parameters, Property, Properties and Recordset


--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Harmannus said:
Hallo,

Thanx for the tip!

Solved it by using other code.

The problem was Dim DB As Database -> Set DB = CurrentDb
No i use Dim con As Object -> Set con =
Application.CurrentProject.Connection
But do i have to do other things now? Defining RS defirently? OR closing Con
and RS on my custom search form as the switchboard does? Not realy sure
here...



Part of search form code:

Con As Objext, rs As Object

Set con = Application.CurrentProject.Connection
Set rs = con.OpenRecordset("SELECT DISTINCTROW " & _
"tblMedewerker.MedewerkerID " & _
"FROM tblMedewerker" & _
" WHERE " & GetStrZoek & ";")
' If none found, then tell them and make me visible to try again
If rs.RecordCount = 0 Then
DoCmd.Hourglass False
MsgBox "Zoekactie levert geen resultaten op!", vbInformation,
[CurrentDb].[Properties]("AppTitle")
GetStrZoek = ""
Me.Visible = True
rs.Close
Exit Sub
End If
' Move to last row to get an accurate record count
rs.MoveLast
lngCount = rs.RecordCount
DoCmd.Hourglass False

Regards,

Harmannus


Allen Browne said:
This is probably a reference issue. From any code window, choose References
from the Tools menu. Make sure you have a reference to:
Microsoft DAO 3.6 Library.
More information on references:
http://allenbrowne.com/ser-38.html

If the error is 3270, choose Startup from the Tools menu, and enter an
application title.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Harmannus said:
Hallo,

Thanx for the suggestion. This has no effect.

What i fount is that [CurrentDb].[Properties]("AppTitle") causes the
problem!

Any suggestions why? Can i use an alternate method? I use this a lot
for
the
title of pop-up screens.


Regards,

Harmannus


Instead of the antiquated DoMenuItem, try:
RunCommand acCmdSelectRecord
RunCommand acCmdCopy
RunCommand acCmdPasteAppend

The list of constants for RunCommand is not well documented, but Terry
Wickenden has a list at:
http://www.tkwickenden.clara.net/

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.


When working in normal mode in my form i have a button to copy a record
that
works with no problems:

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste
Append

But when i access the form through the switchboard i get a
message:
The
command or action "PasteAppend" isn't available now.

Anybody a suggestion what is the problem here?

I use the below code to disable the shift key. I already disabled the
code
but still get the error message on coping a record.

ChangeProperty "StartupForm", dbText, "Switchboard" 'Change to
name
of
startupform
ChangeProperty "StartupShowDBWindow", dbBoolean, False
ChangeProperty "StartupShowStatusBar", dbBoolean, True
ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
ChangeProperty "AllowToolbarChanges", dbBoolean, False
ChangeProperty "AllowFullMenus", dbBoolean, False
ChangeProperty "AllowShortcutMenus", dbBoolean, False
ChangeProperty "AllowBreakIntoCode", dbBoolean, True
ChangeProperty "AllowSpecialKeys", dbBoolean, False
ChangeProperty "AllowBypassKey", dbBoolean, False
 
H

Harmannus

Thanx for the help!

But the swichboard uses Microsoft ActiveX Data Objects 2.1. So i get a
conflict?!? Or should i use DAO based switchboard?

Regards,

harmannus



Douglas J. Steele said:
As I pointed out in response to your AllowBypassKey post, you're trying to
use DAO code, but you don't have a reference set to DAO.

After setting the reference as I explained in the other post, go back to
using Dim DB As Database, and setting it to CurrentDb, but change your
declaration from rs As Object to rs As DAO.Recordset. The problem you're
encountering is that Recordset is an object in both the ADO and DAO models.
Since you only have a reference to ADO, that's what you were getting before.

Actually, if you're not going to be using ADO, uncheck the reference to
Microsoft ActiveX Data Objects 2.1 Library when you add the reference to
DAO. That's because you'll need to disambiguate any of the objects which
occur in both models (like I did using DAO.Recordset above: the equivalent
to guarantee an ADO recordset would be ADODB.Recordset). The list of objects
with the same names in the 2 models is Connection, Error, Errors, Field,
Fields, Parameter, Parameters, Property, Properties and Recordset


--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Harmannus said:
Hallo,

Thanx for the tip!

Solved it by using other code.

The problem was Dim DB As Database -> Set DB = CurrentDb
No i use Dim con As Object -> Set con =
Application.CurrentProject.Connection
But do i have to do other things now? Defining RS defirently? OR closing Con
and RS on my custom search form as the switchboard does? Not realy sure
here...



Part of search form code:

Con As Objext, rs As Object

Set con = Application.CurrentProject.Connection
Set rs = con.OpenRecordset("SELECT DISTINCTROW " & _
"tblMedewerker.MedewerkerID " & _
"FROM tblMedewerker" & _
" WHERE " & GetStrZoek & ";")
' If none found, then tell them and make me visible to try again
If rs.RecordCount = 0 Then
DoCmd.Hourglass False
MsgBox "Zoekactie levert geen resultaten op!", vbInformation,
[CurrentDb].[Properties]("AppTitle")
GetStrZoek = ""
Me.Visible = True
rs.Close
Exit Sub
End If
' Move to last row to get an accurate record count
rs.MoveLast
lngCount = rs.RecordCount
DoCmd.Hourglass False

Regards,

Harmannus


Allen Browne said:
This is probably a reference issue. From any code window, choose References
from the Tools menu. Make sure you have a reference to:
Microsoft DAO 3.6 Library.
More information on references:
http://allenbrowne.com/ser-38.html

If the error is 3270, choose Startup from the Tools menu, and enter an
application title.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Hallo,

Thanx for the suggestion. This has no effect.

What i fount is that [CurrentDb].[Properties]("AppTitle") causes the
problem!

Any suggestions why? Can i use an alternate method? I use this a lot
for disabled
the
 
D

Douglas J. Steele

As long as you correctly disambiguate all references, there should be no
problem using both ADO and DAO in the same application.

Realistically, though, if you're strictly working with a Jet database (i.e.:
if your data is stored in an MDB file), DAO is better than ADO.

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Harmannus said:
Thanx for the help!

But the swichboard uses Microsoft ActiveX Data Objects 2.1. So i get a
conflict?!? Or should i use DAO based switchboard?

Regards,

harmannus



Douglas J. Steele said:
As I pointed out in response to your AllowBypassKey post, you're trying to
use DAO code, but you don't have a reference set to DAO.

After setting the reference as I explained in the other post, go back to
using Dim DB As Database, and setting it to CurrentDb, but change your
declaration from rs As Object to rs As DAO.Recordset. The problem you're
encountering is that Recordset is an object in both the ADO and DAO models.
Since you only have a reference to ADO, that's what you were getting before.

Actually, if you're not going to be using ADO, uncheck the reference to
Microsoft ActiveX Data Objects 2.1 Library when you add the reference to
DAO. That's because you'll need to disambiguate any of the objects which
occur in both models (like I did using DAO.Recordset above: the equivalent
to guarantee an ADO recordset would be ADODB.Recordset). The list of objects
with the same names in the 2 models is Connection, Error, Errors, Field,
Fields, Parameter, Parameters, Property, Properties and Recordset


--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Harmannus said:
Hallo,

Thanx for the tip!

Solved it by using other code.

The problem was Dim DB As Database -> Set DB = CurrentDb
No i use Dim con As Object -> Set con =
Application.CurrentProject.Connection
But do i have to do other things now? Defining RS defirently? OR
closing
Con
and RS on my custom search form as the switchboard does? Not realy sure
here...



Part of search form code:

Con As Objext, rs As Object

Set con = Application.CurrentProject.Connection
Set rs = con.OpenRecordset("SELECT DISTINCTROW " & _
"tblMedewerker.MedewerkerID " & _
"FROM tblMedewerker" & _
" WHERE " & GetStrZoek & ";")
' If none found, then tell them and make me visible to try again
If rs.RecordCount = 0 Then
DoCmd.Hourglass False
MsgBox "Zoekactie levert geen resultaten op!", vbInformation,
[CurrentDb].[Properties]("AppTitle")
GetStrZoek = ""
Me.Visible = True
rs.Close
Exit Sub
End If
' Move to last row to get an accurate record count
rs.MoveLast
lngCount = rs.RecordCount
DoCmd.Hourglass False

Regards,

Harmannus


This is probably a reference issue. From any code window, choose
References
from the Tools menu. Make sure you have a reference to:
Microsoft DAO 3.6 Library.
More information on references:
http://allenbrowne.com/ser-38.html

If the error is 3270, choose Startup from the Tools menu, and enter an
application title.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Hallo,

Thanx for the suggestion. This has no effect.

What i fount is that [CurrentDb].[Properties]("AppTitle") causes the
problem!

Any suggestions why? Can i use an alternate method? I use this a
lot
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top