Recent content by juicybeasty

  1. J

    Date parameter query

    That's exactly what I was looking for, I'll try it. Thanks v much.
  2. J

    Date parameter query

    I have a relatively large database with lots of sum queries within queries which are used as a data source for reports - I suspect I didn't set it up as efficiently as I could have! For all the queries that are required to sum the cumulated data for the financial year - which in my company runs...
  3. J

    'Print Report' command button on form

    It works! Thanks again. Out of interest, why does it have to be CoNumber on the report (control source) but it's ok to refer to CoID on the form (text box name - the control source of frmMain!CoID is also CoNumber)?
  4. J

    'Print Report' command button on form

    First paragraph - correct. The control source is CoNumber. So does this mean I should be using this rather than the name of the text box?
  5. J

    'Print Report' command button on form

    Thanks for looking at the code. I don't know why something so straightforward is turning out so difficult. To clarify: the names of the text boxes on both the form and the report are CoID. CoNumber is the control source in qryPrintFormMain on which rptPrintFormMain is based. So the code...
  6. J

    'Print Report' command button on form

    Here is the code: Private Sub cmdPrintPage_Click() On Error GoTo Err_cmdPrintPage_Click Dim stDocName As String stDocName = "rptPrintFormMain" DoCmd.OpenReport stDocName, acViewNormal, , "CoID=" & Me.CoID Exit_cmdPrintPage_Click: Exit Sub Err_cmdPrintPage_Click: MsgBox...
  7. J

    'Print Report' command button on form

    Thanks for your help with this. I can't post it until tomorrow because it's at work and I'm not! But I will then. No doubt I'm making a stupid mistake.
  8. J

    'Print Report' command button on form

    That's what I did. I put that syntax in the where argument of the OpenReport method of the command button on the form. But you mentioned earlier putting it in the OpenForm method, which I was slightly unclear about. Isn't the form already open? (Although it's just occurred to me that OpenForm...
  9. J

    'Print Report' command button on form

    Unfortunately, it doesn't work. I get a box which says "Enter parameter value" for CoID. This is the same result I got when it didn't work earlier in this thread.
  10. J

    'Print Report' command button on form

    Thanks, I'll try that. Looks like I just got my syntax wrong. Out of interest, why is "CoID=" in inverted commas, and what does the & do? CoID is a number, and I do want to print not just preview it.
  11. J

    Change grey background to Sumi in existing form

    In Access 97 there is a button on one of the toolbars called AutoFormat. Highlight eg the detail section and then click this and it allows you to choose one of the predefined styles. Assume this works the same in Access 2000/XP.
  12. J

    'Print Report' command button on form

    I have made it work using a different method: In the query my report was based on i put in the criteria for CoNumber =Forms!frmMain!CoID And it worked! So no where condition necessary. Would still like to know why this didn't work though, if anyone knows.
  13. J

    'Print Report' command button on form

    I've just tried to do it by setting up a macro and attaching it to my command button (because it seemed simple) and it still hasnt worked. My where condition is: ID=Forms!frmMain!ID Where ID is the name of the text box control with the ID number on it on both the form and the report. It...
  14. J

    'Print Report' command button on form

    Thanks v much. I can see where you're going with this and I'll try it tomorrow at work. It looks really useful as a general purpose strategy and for other things I'm doing. Although I foresee problems with the subreports using this method...
  15. J

    'Print Report' command button on form

    I think you'll have to be more specific - I can be a bit dense! I was thinking vaguely along the lines of: DoCmd.OpenReport "rptPrintFormMain" where Me!CoID = Reports!rptPrintFormMain.CoID in the OpenClick event of the command button. (I'm aware that the syntax is prob not quite right...
Back
Top Bottom