Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    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,870
    Too many people start out think Access is the answer -- don't blame yourself for that. M$oft does a great marketing job (as do many DBMS suppliers) and have lot's of $$ incentive to do so.



    One trick you can do is to put a debug.print in each procedure -- anything with code in it.
    Form load, form open, button click etc.

    Debug.print "entered procedure name here " 'you have to manually enter the procedure names

    Then when you code runs, you can see the steps it went through. It may lead to a routine you didn't expect.
    You can always use step debugging to help with problem resolution.

    Good luck.

  2. #17
    IncidentalProgrammer is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2014
    Location
    Texas
    Posts
    156
    I really do feel like Access can do what we need, it's just a matter of me getting to the point that I can get it to do it. I'd never heard of Access or done any kind of programming until last June, and the only training I have is books, internet, and trial & error.

    I tried changing tactics, a little. Instead of pulling the result by PolID, I tried to write it to pull by policy number (PolNum, a text field), and effective date (PolEffDt, a date field). I've looked at numerous examples online, and my syntax looks right, but I keep getting a type mismatch error when I test it, and I'm not getting anything from debug.print on it. Do you see anything wrong with this statement?

    Code:
    DoCmd.OpenForm "frmPolicy3rd", , , "PolNum = '" & Me.ctlPolNum & "'" And "PolEffDt = #" & Me.ctlPolEffDt & "#"

  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,870
    I don't see anything wrong with the code. But I don't see any reason to move away from PolId.
    Something is interfering--I don't know what exactly. There must be some code executing that is changing
    the logic.

  4. #19
    IncidentalProgrammer is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2014
    Location
    Texas
    Posts
    156
    Well, I played around with the view form's settings. Apparently, there was an outdated query in the source field that I'd forgotten about. Now the button works!

    Thank so much, Orange!

  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,870

  6. #21
    IncidentalProgrammer is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2014
    Location
    Texas
    Posts
    156
    It was a good learning experience. I'm always searching for good syntax examples!

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

Similar Threads

  1. Replies: 21
    Last Post: 08-05-2013, 06:23 AM
  2. Replies: 5
    Last Post: 06-19-2013, 08:01 AM
  3. Replies: 3
    Last Post: 09-20-2012, 11:09 AM
  4. Replies: 7
    Last Post: 05-01-2012, 11:43 AM
  5. Replies: 1
    Last Post: 03-31-2011, 12:18 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