Results 1 to 4 of 4
  1. #1
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368

    using checkbox as iif criteria

    Hi all.



    In part of my workflow, I am given an xls document which may or may not contain a field called "ListMonth." What I want to do on my form is create a checkbox that will allow the user to check whether the field is present. If so, I wish to use the field ListMonth. If not, I want to prompt the user to enter a month.

    What I have currently:
    ReviewMonth: IIf(Forms!myForm!chkListMonth= -1, myTable.ListMonth, [Enter Month of Campaign])

    This, however, always prompts for the month of the campaign. I've spelled everything correctly. Thoughts?

    Thank you

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    I don't think you can issue an optional parameter, Shabz. I might be wrong though. (do you the PARAMETERS statement included as part of the sql?)

    What you can do though, is create a query dynamically through code using an input box based on a conditional statement. would that suffice?

  3. #3
    SteveF is offline Generally AccessAble
    Windows XP Access 2010 (version 14.0)
    Join Date
    Nov 2010
    Location
    Fourth Corner
    Posts
    123
    Let's make sure I understand your workflow -- you're importing this XL file into an Access table?

    If yes, then there's another way to solve this. I would do all of the following in VBA behind a form:
    1. import the file
    2. check the ListMonth column for the presence of data
    3. if any rows in ListMonth are empty, prompt for entry
    4. use this entry in an Update Query to populate the empty ListMonth rows

    I know I've seen posts from you here where you're providing assistance, so I know you're not a rank beginner. If you do need assistance with any of these steps, give a holler. For file importing via a form, I use Bill Wilson's BrowseForFileClass, which I started to use a looong time ago. If you don't have it, or something similar, I'll be glad to send it your way or post it here on the forum.

    Steve

  4. #4
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    Adam, I wanted to avoid doing it in VBA (my coworkers are horrible at VBA and if I'm not here and they need to tweak it, well, yea.) and was kinda hoping this would be the non-code way around it. I'll just code it, they need to learn anyway. Thanks.

    Steve, thanks for your input.

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

Similar Threads

  1. Checkbox and value not null
    By Alaska1 in forum Security
    Replies: 3
    Last Post: 11-29-2010, 07:30 PM
  2. Checkbox
    By Patience in forum Access
    Replies: 5
    Last Post: 06-22-2010, 05:37 AM
  3. Using a checkbox help
    By gbjc105 in forum Forms
    Replies: 1
    Last Post: 01-28-2010, 08:27 PM
  4. Checkbox
    By Rbtsmith in forum Access
    Replies: 2
    Last Post: 02-17-2009, 04:19 PM
  5. checkbox
    By Suresh in forum Forms
    Replies: 0
    Last Post: 12-19-2007, 01:30 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