Results 1 to 5 of 5
  1. #1
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383

    Open Report From Subform on Main Form

    I am missing something here, don't know what it is?

    Main form is named CheckRegister and subform is named FReg


    Report(s) are named ??? What's wrong with my syntax?


    [BalDate] Between Forms!CheckRegister!FReg.Form!StartDate And Forms!CheckRegister!FReg.Form!EndDate And Void <3"

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Are you doing this in code? what is the rest of the code?

    You might try:
    Code:
    ([BalDate] Between Forms!CheckRegister!FReg.Form!StartDate And Forms!CheckRegister!FReg.Form!EndDate) And (Void <3)

  3. #3
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383

    Asks For Criteria

    Here is the complete code and it is on the subform being called from a command button; CheckRegister is Main Form and FReg is subform.
    DoCmd.OpenReport stDocName, acPreview, , "([BalDate] Between Forms!CheckRegister!FReg.Form!StartDate And Forms!CheckRegister!FReg.Form!EndDate) And (Void <3)"
    Attached Thumbnails Attached Thumbnails CheckRegisterDateCriteria.jpg  
    Last edited by burrina; 12-25-2012 at 07:02 PM. Reason: Preview of What Happens

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    You have to concatenate the dates.

    Since the button is on the subform, you could try:
    Code:
    DoCmd.OpenReport stDocName, acPreview, , "([BalDate] Between #" & Me.StartDate & "# And #" & Me.EndDate & "#) And (Void <3)"
    If that doesn't work, try:
    Code:
    DoCmd.OpenReport stDocName, acPreview, , "([BalDate] Between #" & Forms!CheckRegister!FReg.Form!StartDate & "# And #" & Forms!CheckRegister!FReg.Form!EndDate & "#) And (Void <3)"

  5. #5
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Thanks, the first one did the trick. Funny how Access accepted the code when it was not being used on a subform and now not?
    Not just that is on a subform but Access 2010 totally sucks. Wish I had never bought it. Have to change the code for it to work? Nevermind the subform, I don't get it!

    Oh well, enough of my rant, Many thanks to you!!! That's what I get for moving it to a a main form.

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

Similar Threads

  1. Replies: 3
    Last Post: 04-17-2012, 10:28 AM
  2. Replies: 11
    Last Post: 01-26-2012, 01:22 PM
  3. Replies: 1
    Last Post: 12-04-2011, 09:11 PM
  4. Replies: 5
    Last Post: 11-11-2011, 11:06 AM
  5. Replies: 2
    Last Post: 08-11-2011, 10:02 AM

Tags for this Thread

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