Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    Ally1205 is offline Advanced Beginner
    Windows 7 64bit Access 2000
    Join Date
    Jul 2013
    Posts
    68

    Access 2000: opening a report with a button on more than one form.

    Hello all,
    My Acess2000 database holds records of members of an organization which I manage. I've got a button on my most-used form, called 'local members and helpfulness', which opens a report designed to print one envelope, using address data from the current member record showing in the form. I did this by configuring the button execute a macro. The button's 'On click' event is set to the macro name: 'mcrPrintC5env':


    Click image for larger version. 

Name:	domacro1.JPG 
Views:	29 
Size:	19.7 KB 
ID:	14622

    It works fine; the report shows up in preview mode so that I can click 'print' to print off that single addressed envelope. However, if I put an identical button on another form which uses the same data from the same "local members list" table (via a different query), it doesn't work. When I click the button in form view, a popup input box appears:
    Click image for larger version. 

Name:	input box1.JPG 
Views:	28 
Size:	13.7 KB 
ID:	14623
    Can anyone tell me how to rectify this problem? Sorry if it's a dumb question! ...Thank you!

  2. #2
    BluffMeAllIn is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2013
    Location
    Canada
    Posts
    21
    HI Ally,

    When you put the identical button on a different form did you copy and past or actually create a new button and new macro for it identical to the previous? The popup box is looking for a parameter of Forms!local members and helpfulness because it does not recognize this as a variable or essentially opened form to pick reference from.

    In the details of the macro, I don't use them much myself as I actually prefer to code the VBA for more control, but it must have reference to the form that the button/macro were created on and so copying it to a new form isn't working because its a new form. Easiest suggestion would be to create the button and macro on the new form from scratch or get into the details of the macro and associate it to the new form.

    Clear as Mud??

    Dave

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by Ally1205 View Post
    .....
    identical button on another form which uses the same data from the same "local members list" table (via a different query), it doesn't work. When I click the button...Thank you!
    Like Dave mentioned, your report is looking for a parameter that is not available. It seems your macro is looking for a specific form name. You will probably need another macro for the second form. Also, your control button name should not be part of the Where Condition.

    Maybe it will be easier to write out some VBA. Why not start with using the Wizard to create a new control button on the second form. The wizard will ask if you want specific criteria to be displayed. If you are still having trouble, post the VBA that the Wizard creates for the newest control button's Click Event.

  4. #4
    Ally1205 is offline Advanced Beginner
    Windows 7 64bit Access 2000
    Join Date
    Jul 2013
    Posts
    68
    Dave,
    Thank you for the reply. I have already tried putting a new button on the second form, and configuring it the same as the other button. I get the same result described in my first message. I'm not savvy on coding, but the first form, with the correctly-working button has the following code in its 'On Current' event procedures):
    - - - - - - - - - -
    Private Sub cmdPrintC5_Click()
    On Error GoTo Err_cmdPrintC5_Click

    Dim stDocName As String

    stDocName = "rptPrintC5env"
    DoCmd.OpenReport stDocName, acNormal

    Exit_cmdPrintC5_Click:
    Exit Sub

    Err_cmdPrintC5_Click:
    MsgBox Err.Description
    Resume Exit_cmdPrintC5_Click
    End Sub
    - - - - - - - - - - - -
    The second form (with the disfunctional button) has the following code in its On Current event procedures:
    - - - - - - - -
    Private Sub cmdPrintC5_Click()
    DoCmd.RunCommand acCmdSaveRecord
    DoCmd.OpenReport "rptPrintC5env", acViewPreview, , "[MailingListID] = " & [RecordID]
    Me.Visible = False
    End Sub
    - - - - - - -
    Looking at the button's 'on click' coding, I see this:
    Click image for larger version. 

Name:	domacro2.JPG 
Views:	24 
Size:	20.5 KB 
ID:	14642
    Regards
    Ally1205

  5. #5
    BluffMeAllIn is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2013
    Location
    Canada
    Posts
    21
    Hi Ally,

    Perhaps there is an onOpen even of some kind associated with the rptPrintC5env because from what you have above as indicated there is no specific association to the form indicated in the error message. Therefore it would seem that the report has logic of some kind which is trying to reference the local members and helpfulness form.

    You will need to have a look at the report itself and determine what macro's or vba logic might be associated with events for the form. You can look at the events through the properties same as you would a form.

    Thanks,
    Dave

  6. #6
    Ally1205 is offline Advanced Beginner
    Windows 7 64bit Access 2000
    Join Date
    Jul 2013
    Posts
    68
    Dave, The report has a 'Filter' property that references the 'members and helpfulness' form.:
    Click image for larger version. 

Name:	report-props1.JPG 
Views:	23 
Size:	43.6 KB 
ID:	14645
    Should I make a new report and new macro for each form which needs to print envelopes, with each report referencing (in the 'Filter' property) the specific form that bears the actual command button that executes the macro that opens the form-specific report? (Hope that phraseology made sense!) Having asked all that, I see that the next property under Filter, specifies that the Filter is not 'on'... so is it even needed? I don't remember having this problem when I built a very similar application in Access95 some years ago.
    Thanks again,
    Regards,
    Ally1205

  7. #7
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    If you like, you can remove the filter on the form and we can provide you with the appropriate code for your forms. You can also upload your DB for analysis. Just remove private data. There is not any need to create another report.

  8. #8
    Ally1205 is offline Advanced Beginner
    Windows 7 64bit Access 2000
    Join Date
    Jul 2013
    Posts
    68
    Thanks, ItsMe. I removed the filter in the report's Filter property, but the result was exactly the same. Where should I upload my DB to?
    Ally
    Last edited by Ally1205; 12-05-2013 at 11:20 AM.

  9. #9
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Make a copy of your DB and use the copy.

    In the table, use Ctrl + A to select all of the records. Use the Shift key to click a few records and de-select them. Now you can delete the highlighted ones. Leaving a few records will help to test the DB. Change some of the fields with names, Social Sec numbers, Phone, etc.

  10. #10
    Ally1205 is offline Advanced Beginner
    Windows 7 64bit Access 2000
    Join Date
    Jul 2013
    Posts
    68
    Thanks - I did that okay. Is it my .mdb file that I should upload? I tried to attach it to a 'new thread' message (per the FAQ), but the upload failed (twice)...

  11. #11
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    It might be too large of a file. What ever format is fine as long as it is not 2013. Try removing objects that are not needed and zip the file down.

  12. #12
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    The record source for the report - Local Members List - is that a table or a query? If it is a query, are there any criteria expressions in the query which refer to a field on the form Local Members and Helpfulness ? If so, that may the source of your error - if you try running the report from a different form, then the query cannot find the form Local Members and Helpfulness, (it's not open), so it asks you to supply a value through the "Enter Parameter Value" dialog.

    HTH

    John

  13. #13
    Ally1205 is offline Advanced Beginner
    Windows 7 64bit Access 2000
    Join Date
    Jul 2013
    Posts
    68
    Hi John, Thank you for the suggestion. 'Local Members List' is the name of the main table. Each form I use gets its data from a query (a different query for each form. Each query draws data from the main 'Local Members List' table and a (linked) secondary table.).
    Regards,
    Ally1205

  14. #14
    Ally1205 is offline Advanced Beginner
    Windows 7 64bit Access 2000
    Join Date
    Jul 2013
    Posts
    68
    Quote Originally Posted by ItsMe View Post
    It might be too large of a file. What ever format is fine as long as it is not 2013. Try removing objects that are not needed and zip the file down.
    Thanks... I will try your suggestions in about 12 hours, when I'm back on my office PC with the DB on it.
    Ally1205

  15. #15
    Ally1205 is offline Advanced Beginner
    Windows 7 64bit Access 2000
    Join Date
    Jul 2013
    Posts
    68

    Ally1205 zipped DB attached

    I have attached my zipped Access2000 mdb file: Ally1205.zip. (It wouldn't upload until I zipped it.)

    Thanks for the kind help,
    Ally1205
    Attached Files Attached Files

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 06-05-2012, 01:47 PM
  2. Replies: 3
    Last Post: 07-13-2011, 02:04 PM
  3. Opening Access 2000 file in Access 2010
    By Jacob in forum Access
    Replies: 10
    Last Post: 02-12-2011, 06:56 AM
  4. Opening Database between 2007 and 2000
    By jo15765 in forum Access
    Replies: 19
    Last Post: 11-21-2010, 06:46 PM
  5. Report trouble in Access 2000
    By blago in forum Reports
    Replies: 13
    Last Post: 09-16-2010, 07:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums