Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 33
  1. #16
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Create 2 variables, StartDate, EndDate and store the values there:


    StartDate = strOpenArgs(0)
    EndDate = strOpenArgs(1)
    ...then the ControlSource of the TextBoxes on ruour report will be =StartDate and =EndDate respectively.

  2. #17
    BigCat's Avatar
    BigCat is offline Vice Pres. of Napping
    Windows XP Access 2007
    Join Date
    May 2011
    Location
    Box Canyon
    Posts
    52
    It is still trying to turn Start Date into a column name, because I get the same error saying 'StartDate' is not a valid column name.

  3. #18
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Did you Dim the two variables at the top of the code module for the Report?

  4. #19
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I'll check back in when I get back from my appointment. I'll be gone for several hours, sorry.

  5. #20
    BigCat's Avatar
    BigCat is offline Vice Pres. of Napping
    Windows XP Access 2007
    Join Date
    May 2011
    Location
    Box Canyon
    Posts
    52
    Well I was debugging the code in VBA I put in some breakpoints and it is jumping over the if and going to the else. I put a msgBox in the else to check if it was working and it executed my else msgbox.

    So possibly if I can figure out why it is jumping my if. I can fix it and maybe that should solve it.

  6. #21
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    So the Report is not seeing any OpenArgs?

  7. #22
    BigCat's Avatar
    BigCat is offline Vice Pres. of Napping
    Windows XP Access 2007
    Join Date
    May 2011
    Location
    Box Canyon
    Posts
    52
    Correct, or at least from my debugging that seems to be the case. Since it hits the if clause and then jumps to the else and executes the MsgBox within the else.

  8. #23
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Any chance you can post your db?

  9. #24
    BigCat's Avatar
    BigCat is offline Vice Pres. of Napping
    Windows XP Access 2007
    Join Date
    May 2011
    Location
    Box Canyon
    Posts
    52
    Here you go. If you have questions about what I am trying to do you can ask. Right now I am just trying to get the Monthly Sales summary to run with the dates on it, because then I should be able to copy paste that code into the other reports.

  10. #25
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    What form is opening this report? It would have been nice to be warned this was an ADP.

  11. #26
    BigCat's Avatar
    BigCat is offline Vice Pres. of Napping
    Windows XP Access 2007
    Join Date
    May 2011
    Location
    Box Canyon
    Posts
    52
    Sorry I always forget to warn people about it being an ADP. The flow of forms is a follows: HomeScreen->ReportExport->SalesDates->Monthly Sales Summary(Report)

  12. #27
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I can't run the ADP but see what this does.

  13. #28
    BigCat's Avatar
    BigCat is offline Vice Pres. of Napping
    Windows XP Access 2007
    Join Date
    May 2011
    Location
    Box Canyon
    Posts
    52
    I get this error. Error 2467: The expresstion you entered refers to an object that is closed or doesn't exist.

  14. #29
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I'm sort of stuck then since I can't do any real testing with your system, sorry.

  15. #30
    BigCat's Avatar
    BigCat is offline Vice Pres. of Napping
    Windows XP Access 2007
    Join Date
    May 2011
    Location
    Box Canyon
    Posts
    52
    Thanks for your help though.

Page 2 of 3 FirstFirst 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Adding Filter Using Macro
    By TxTcher in forum Forms
    Replies: 1
    Last Post: 02-05-2013, 02:16 AM
  2. Subform Filter based on Main Form Information
    By james.carpenter2 in forum Forms
    Replies: 0
    Last Post: 02-16-2011, 09:55 PM
  3. report header
    By nashr1928 in forum Reports
    Replies: 2
    Last Post: 07-13-2010, 12:34 PM
  4. Replies: 3
    Last Post: 02-17-2010, 02:29 PM
  5. Report Header on Each Page
    By nweird in forum Reports
    Replies: 1
    Last Post: 07-24-2009, 07:57 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