Results 1 to 2 of 2
  1. #1
    NLA is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2012
    Posts
    2

    Macro - Open Report, SetValue

    I have a report (selected from Switchboard) dependent upon a parameter query that gets its value from a form combo box [frmDocument.DFilename]. That combobox row source is a select statement for a specific table field[tblDocument.DFilename]. This report works as intended.



    I would like to use the same report but run it from a different form (not the Switchboard) and get the value from the new form instead of the parameter query from the first form. I thought to accomplish this i could use SetValue to set the value [frmDocument.DFilename] = [frmMatrix.Filename] (new form textbox). This is ok, but my macro stops because i believe the value being set from new textbox to existing combobox is not being passed to the parameter query.

    Is there a way to use SetTempVar to set the new form textbox [frmMatrix.Filename] value to equal the query Filename field instead of parameter query getting the value from [frmDocument.DFilename]??

    Thanks for any feedback/suggestions on this.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Don't use parameter query (I rarely do). Use the WHERE CONDITION of OpenReport. I use only VBA so not sure what the macro equivalent would be:

    DoCmd.OpenReport "reportname", , , "DFilename='" & [frmMatrix.Filename] & "'"
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 11-08-2012, 05:22 AM
  2. SetValue Macro
    By BrianF in forum Programming
    Replies: 1
    Last Post: 10-21-2012, 08:49 PM
  3. SetValue Macro action
    By rkalapura in forum Programming
    Replies: 3
    Last Post: 12-19-2011, 11:54 AM
  4. No SetValue in Macro editor
    By asabri in forum Programming
    Replies: 2
    Last Post: 09-21-2011, 01:39 PM
  5. Problem with SetValue Macro on Form
    By Accidental DBA in forum Forms
    Replies: 3
    Last Post: 04-01-2011, 01:48 PM

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