Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  1. #16
    khayward is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Apr 2017
    Location
    Oregon
    Posts
    89
    Thank you! I am going to test this out later this week, I had a look at the changes that were made and think I understand what I am seeing for the most part. The part that jumps out at me is it looks like the code inserts the report number into the field on the report rather than the field having a control source from which it pulls, so a push rather than a pull - is that somewhat correct?

    Quote Originally Posted by Micron View Post
    I replaced your embedded macro thinking I might teach about some code but I later saw you have similar code elsewhere.
    I am always happy to learn more if I can - I am afraid I appear to learn best when trying to solve a problem, so much of what you see was cobbled together, each piece an attempt to move closer to a functioning system. my knowledge of VB and macros is admittedly very slim.

    Notes
    - only 3 form modules have Option Explicit in them - should be in all. I always have this option turned on.
    I am afraid that I don't know enough to understand how this affects things
    - your code doesn't compile. Perhaps that is because you removed something for your post.


    This is another area where I am ignorant, could you help me learn?

  2. #17
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Yes, the code puts the number into the report control. This is because although there is a table with one record to hold a number, it isn't part of the report recordset. To make it so would require joining that table to the mash of queries you use to get where you are. There is no common field between them so I took the easy way out.

    Hit your vb editor compile button and one error will get caught (assuming what you posted is a near enough copy of what you are working with). See what that is all about, fix it (or temporarily comment out the code line) and keep going. Such issues are potentials for run time errors. Research Option Explicit, and while you're at it, learn about Option Compare as well - might come in handy one day. Make Google (or something similar) your go to place for answering your Access questions.

    Hint - when I want to temporarily comment out something in code I use 3 ' (''') because that would likely be unique and easy to find with ctrl+F
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 4
    Last Post: 11-15-2018, 09:39 PM
  2. Replies: 5
    Last Post: 11-30-2014, 12:46 PM
  3. Replies: 7
    Last Post: 10-29-2014, 11:48 AM
  4. Replies: 2
    Last Post: 10-27-2014, 01:23 PM
  5. Giving a specific number to some data
    By Knelou in forum Forms
    Replies: 1
    Last Post: 09-12-2013, 08:45 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