Results 1 to 8 of 8
  1. #1
    bmschaeffer is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2011
    Posts
    24

    Macro Question Please Help


    I have created a macro that uses the action "SetValue" to fill out a form, run a report, and output to a folder. The problem I have is that every month I have to change the SetValue to the next month. VBA is not my thing, but is there a way to do a find and replace all SetValues in the macro design? I need to change 8 (Aug) to 9 for Sept.

    Thanks for your help in advance!

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Why are you filling out the form using the set value of the macro instead of just filling out the form?

    What is the process for this? Can you just have a combo box with the months in there and select it and have the macros reference it?

  3. #3
    bmschaeffer is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2011
    Posts
    24
    There are about 100 different reports that need to be saved off individually into a shared folder. I was using the form to to do this, but the macro can automate this process for me. If you have a different approach on how to do this, please let me know. I am new to access and have used macros in excel before, that's why I went this route.

  4. #4
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Okay, I'm still a bit confused as to why you have a macro setting the value in the form. Can't you set the value in the form and then have the macro fire to save each report?

  5. #5
    bmschaeffer is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2011
    Posts
    24
    As I said I am new at this, so I could be doing it in a round about way. What is the macro action to refer to a text box in a form?

    Thanks for the quick replies!

  6. #6
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Quote Originally Posted by bmschaeffer View Post
    What is the macro action to refer to a text box in a form?
    There isn't an "Action" to do that. You don't need an Action. What you need is to have the query underlying the reports to reference that form control as the criteria.

  7. #7
    bmschaeffer is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2011
    Posts
    24
    Got it!!! Thanks for your help this will save me a lot of time in the future. One last question, if my macro refers to a form or report, and I change the name of that report, will my macro automatically update to the name change? If not, is there a way I can easily do that?

  8. #8
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    No it will not update to the name change. If you are going to have report name changes then you should just create a table for storing the name of the reports you will want to run and then have it loop through the table using a recordset in VBA (not macro - sorry, but it would be good to move a bit in that direction and we can help).

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

Similar Threads

  1. Question: SigmaPlot macro syntax error
    By Captain Database ...!! in forum Import/Export Data
    Replies: 2
    Last Post: 03-27-2012, 10:04 AM
  2. Form / Macro Question
    By kilosierra71 in forum Access
    Replies: 5
    Last Post: 07-26-2011, 10:13 AM
  3. Question about some code in a macro
    By AudiA4_20T in forum Programming
    Replies: 2
    Last Post: 07-11-2011, 08:16 AM
  4. Macro Question
    By jo15765 in forum Access
    Replies: 6
    Last Post: 01-20-2011, 07:53 AM
  5. Macro Question
    By Desstro in forum Programming
    Replies: 1
    Last Post: 06-18-2010, 10:05 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