Page 2 of 2 FirstFirst 12
Results 16 to 26 of 26
  1. #16
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    My bad... I didn't see an extra bracket in front of FORMS:



    Code:
    SomeDate:IIf(Len(Trim([[Forms]![frmBids].[BidDateSelector] & ""))=0,"7/19/2012",[BidDateSelection])
    This doesn't error out:
    Code:
    SomeDate:IIf(Len(Trim([Forms]![frmBids].[BidDateSelector] & ""))=0,"7/19/2012",[BidDateSelection])



    From your first post:
    What I am trying to do, is have the "BidDateSelection" set to 7/19/2012 when the field is blank but my code does not work. I
    I would think the formula would be:
    Code:
    SomeDate:IIf(Len(Trim([BidDateSelection] & ""))=0,"7/19/2012",[BidDateSelection])

  2. #17
    jre1229 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2012
    Posts
    30
    Both of these gives me the information for 7/19 regardless of the date I selected on the "BidDateSelector"

  3. #18
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,737
    Can you post a copy of your data base - remove any confidential/personal info?

    Can you post the code for the Query that gets data for the report?

  4. #19
    jre1229 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2012
    Posts
    30
    Quote Originally Posted by orange View Post
    Can you post a copy of your data base - remove any confidential/personal info?

    Can you post the code for the Query that gets data for the report?
    Here is an .mdb version that should work. Copy of 8-2.zip

  5. #20
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,737
    I looked at your database.
    Error onLoad see attached.
    Error when trying to open Form see attached.

    I can not open you database without errors. If i try to open a Form I also get an error.
    I think, based on my small test, you have serious structure issues.

    I suggest you tell us in 3-5 lines what exactly this database is for, so that we can get some feel for what it is you are trying to do.
    You may want to tell us about your tables, forms and reports as well.
    Attached Thumbnails Attached Thumbnails Copy8-2ErrorOnLoad.jpg   Copy8-2ErrorOpeningForm.jpg  

  6. #21
    jre1229 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2012
    Posts
    30
    Quote Originally Posted by orange View Post
    I looked at your database.
    Error onLoad see attached.
    Error when trying to open Form see attached.

    I can not open you database without errors. If i try to open a Form I also get an error.
    I think, based on my small test, you have serious structure issues.

    I suggest you tell us in 3-5 lines what exactly this database is for, so that we can get some feel for what it is you are trying to do.
    You may want to tell us about your tables, forms and reports as well.
    The error onLoad came from me taking out 90% of the database due to confidential information. I'm not sure why you get the second error, as I don't get that error. I am going to try and make this as simple as possible using a separate example, maybe I can better relay it that way.

    I have a form, called "FORM"
    On FORM, I have a datepicker, called "DATEPICKER"
    On FORM, I have a button, called "BUTTON"
    On FORM, I have a subreport, called "SUBREPORT"
    The data for this subreport pulls from a query, that populates from a table. We will call these "TABLE" and "QUERY".
    In TABLE, I have a field called "DATEFIELD" along with other fields that aren't relevant. QUERY pulls all fields from TABLE.

    What I am trying to do, is select a date in DATEPICKER, click BUTTON to update SUBREPORT. What I want QUERY to pull, is all data where DATEFIELD = DATEPICKER.VALUE. If DATEPICKER is left blank, and BUTTON is clicked, I want QUERY to show me all data.

    That's about as simple and straightforward as I can come up with.

  7. #22
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,737

  8. #23
    jre1229 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2012
    Posts
    30
    No, what did you want me to attach? I was just describing a hypothetical situation to try and better explain what I am doing.

  9. #24
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    On FORM, I have a subreport, called "SUBREPORT"
    You need to start by changing your design. You cannot have a subREPORT on a form - on a form, it *MUST* be a subFORM.



    What I am trying to do, is select a date in DATEPICKER, click BUTTON to update SUBREPORT. What I want QUERY to pull, is all data where DATEFIELD = DATEPICKER.VALUE. If DATEPICKER is left blank, and BUTTON is clicked, I want QUERY to show me all data.
    Can you post the SQL of the query?

    See this site
    http://access.mvps.org/access/queries/qry0001.htm



  10. #25
    jre1229 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2012
    Posts
    30
    Quote Originally Posted by ssanfu View Post
    You need to start by changing your design. You cannot have a subREPORT on a form - on a form, it *MUST* be a subFORM.


    Can you post the SQL of the query?

    See this site
    http://access.mvps.org/access/queries/qry0001.htm


    Ok, the subreport is actually in a subform, I just left that part out. I don't have code for the SQL of the query as I was just making up a simple example of what I am trying to do without getting everyone caught up in how I was naming everything in my actual DB.

  11. #26
    jre1229 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2012
    Posts
    30
    Quote Originally Posted by ssanfu View Post
    You need to start by changing your design. You cannot have a subREPORT on a form - on a form, it *MUST* be a subFORM.

    Can you post the SQL of the query?

    See this site
    http://access.mvps.org/access/queries/qry0001.htm

    I looked at the link you posted and used they code they have and it worked perfectly! Thanks!

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

Similar Threads

  1. Copy data into a blank field
    By winterh in forum Database Design
    Replies: 2
    Last Post: 04-16-2012, 04:57 AM
  2. Querying Treaty Data
    By ohthesilhouettes in forum Queries
    Replies: 1
    Last Post: 06-15-2011, 11:13 AM
  3. Replies: 4
    Last Post: 05-11-2011, 03:06 AM
  4. Adding field to form causes blank view.
    By emccalment in forum Access
    Replies: 1
    Last Post: 04-02-2010, 06:27 PM
  5. Replies: 1
    Last Post: 03-15-2009, 04:46 PM

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