Results 1 to 6 of 6
  1. #1
    d9pierce1 is offline Expert
    Windows 10 Access 2019
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    776

    Group Choose Option on subform question?

    Hi all,


    I recently added this and I cannot get it to work correctly.
    Code:
    =Choose([grpFilterOptions],"[TransDate] Between #" & [Forms]![frmAccountHolder].[sfrmAccountOther].[Form].[BeginningTransDate] & "# AND #" & [Forms]![frmAccountHolder].[sfrmAccountOther].[Form].[EndingTransDate] & "#","")
    The primary form is frmAccountHolder
    The subform is sfrmAccountOther
    the form I am on in this subform is frmAccountReport

    I am getting a parameter of TransDate and I cannot figure out how to get the frmAccountReport into the code above. Basically I need to figure out how to add frmAccountReport into this code as its not finding this form to get the transdate from?
    Thank you all
    Dave

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,938
    http://access.mvps.org/access/forms/frm0031.htm

    if you are running that code in frmAccountReport then you can just use Me. ?

    Is that even the correct syntax for Choose() ?
    https://support.microsoft.com/en-gb/office/choose-function-fc5c184f-cb62-4ec7-a46e-38653b98f5bc
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    d9pierce1 is offline Expert
    Windows 10 Access 2019
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    776
    Thanks Welshgasman,
    I have tried everyone of the options in your link, most even prior to posting this.
    If I enter a date in the popup "Enter Parameter" then the report opens just fine. So it has to be not finding the [TransDate] within that statement on the form.
    Baffles me

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,938
    Well Transdate should be the field in the table?
    What exactly are you trying to do?
    I see no point of choose if you only have one choice?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    WGM, as I see it there are 2 choices - a where clause (without the word Where) and a zls.
    I cannot figure out how to get the frmAccountReport
    I guess sfrmAccountOther is your subform control? Then you don't need to - it is referenced by the word Form, as in sfrmAccountOther.Form
    Are you getting a parameter prompt for TransDate, or the beginning or ending dates?

    My guess is that you're using an option group to make clause choices for a sql statement. If you fix the parameter prompt I don't see how you can use "" as a criteria option for dates, unless maybe your dates are really strings.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    d9pierce1 is offline Expert
    Windows 10 Access 2019
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    776
    Hi guys,
    I am sorry, I didnt have a TransDate in the report Query.
    Thank you all for assisting me. I got it to work just fine with adding the transdate to the query!
    My BAD
    Dave

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

Similar Threads

  1. DLookUp with option group and If statements question
    By d9pierce1 in forum Programming
    Replies: 5
    Last Post: 04-18-2022, 02:38 AM
  2. Replies: 6
    Last Post: 07-11-2017, 09:33 AM
  3. Option Group question
    By vickster3659 in forum Forms
    Replies: 3
    Last Post: 10-31-2014, 11:21 AM
  4. Option Group Question
    By chef6886 in forum Programming
    Replies: 4
    Last Post: 01-18-2013, 09:10 PM
  5. Choose Import Spec from option group
    By thart21 in forum Import/Export Data
    Replies: 4
    Last Post: 06-29-2011, 10:37 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