Send Object Action

  • Thread starter Thread starter Nigel
  • Start date Start date
N

Nigel

When using the docmd.sendobject action and not specifying
the output format, a popup box will appear asking what
type of format to export. Is it possible to modify that
list to only show certain types ie excel and access
snapshot

Thanks

Nigel
 
Is it possible to modify that list to only show certain types ie excel and
access
snapshot

No. but you can prompt the user before issuing the command and handle the
response accordingly:
**********************
bolOutput = False

Do While bolOutput = False
strResponse = nz(InputBox("Enter the desired export format (type
'Excel', 'Access' or 'Cancel'","Enter Export Format")," ")

Select Case Ucase(Left(strResponse,1))
Case " "
' No response. No nothing (i.e., Prompt again)
Case "C"
' User Canceled
Exit Sub
Case "E"
' Export to Excel
bolOutput = True
DoCmd.SendObject [x],[y],[z],acFormatXLS
Case "A"
' Export to Access snapshot
bolOutput = True
DoCmd.SendObject [x],[y],[z],acFormatSNP
Case Else
' Unexpected response. No nothing (i.e., Prompt again)
End Select
Loop
********************
' Note: although acFormatSNP is a valid Access constant, it is NOT one of
the 5 listed as acceptable values for this argument in the Help file for
SendObject (AccXP) . Therefore, this might raise an error (the above is
untested aircode). On the other hand, I suspect the AccXP Help file contains
a typo here because it refers to the xlSendObjectOutputFormat constant which
would seem to be a little out of place in the Access object model.

HTH,
 
Back
Top