I'm sure this problem was addressed yesterday in AccessDevelopers forum. 
Probably delivery to ms_access forum was just delayed.

Cheers

Liveson


  ----- Original Message ----- 
  From: k.storeybradfield1 
  To: [email protected] 
  Sent: Thursday, 11 June, 2009 15:56 PM
  Subject: [ms_access] VBA Code Issue






  I have the following code behind my report button that gives me a snap
  shot of my reports, but the way the code should work is given me the
  option to view the current record in the form or print all. When I
  select the option to only show the current record is printing all as if 
  I pressed "No". Any help on this will be greatly appreciated.

  Thanks!

  K.storey

  ___________________________________

  Dim strReportName As String
  Dim strCriteria As String

  strReportName = "[rptRecipe Details]"

  If NewRecord Then
  MsgBox "This record contains no data. Please select a record to print or
  Save this record." _
  , vbInformation, "Invalid Action"
  Exit Sub
  ElseIf MsgBox("Do you want to print just the current record?" & vbCrLf &
  vbCrLf & "(Note: Selecting 'No' will print all records.)", vbYesNo,
  "Print Current Record?") = vbYes Then
  strCriteria = "[RecipeID]= " & Me![RecipeID]
  'strCriteria = "[RecipeID]='" & Me![RecipeID] & "'"

  DoCmd.OpenReport strReportName, acViewPreview, , strCriteria, acHidden
  (I get an compile error code highlighting OpenReport --stating Wrong
  number of arugments or invalid property assignment when opening the
  database in Access 2000) any suggestions to help correct it?

  End If
  DoCmd.OutputTo acOutputReport, strReportName, acFormatSNP,
  "e:\temp\report.snp", True
  DoCmd.Close acReport, strReportName

  End Sub

  [Non-text portions of this message have been removed]



  

[Non-text portions of this message have been removed]

Reply via email to