User Profile

Collapse

Profile Sidebar

Collapse
martin DH
martin DH
Last Activity: Oct 24 '08, 05:56 PM
Joined: Feb 27 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • martin DH
    replied to Changing report source query at runtime
    Thanks, NeoPa, for your responses. I agree with your tidier notion and changed the code to below which works as intended.
    Code:
    Private Sub Report_Open(Cancel As Integer)
    'changes sort order on report by changing control source for sorting/grouping
     
      Select Case Forms!frmAgedNotices.fraSort
      Case 1
        With Me.GroupLevel(1)
          .ControlSource = "Age"
          .SortOrder = True
    ...
    See more | Go to post

    Leave a comment:


  • martin DH
    replied to Changing report source query at runtime
    OK, thanks to both of you. After doing some reading on MSDN at http://msdn.microsoft.com/en-us/libr...ffice.11).aspx, I decided upon the following solution. This works perfectly - the user selects a sort option from frmAgedNotices and clicks a command button that opens the report, running the following on open.

    Code:
    Private Sub Report_Open(Cancel As Integer)
    'changes sort order on report by changing control source for
    ...
    See more | Go to post
    Last edited by NeoPa; May 30 '08, 09:42 AM. Reason: Indenting code properly

    Leave a comment:


  • martin DH
    replied to Changing report source query at runtime
    Thanks, Stewart and NeoPa. As I was typing my post I began to think that I would have to programmaticall y change the sort/group order, not the record source. Unfortunately, when I search for help on the CreateGroupLeve l Method, Microsoft takes me to a "content not found" page.

    I really have no experience here - any guidance would be much appreciated. Thank you.
    martin
    See more | Go to post

    Leave a comment:


  • martin DH
    replied to Changing report source query at runtime
    Okay, here's my situation:

    I would like to open a single report in one of two sort orders based on a selection on a form. I have two queries (one with one sort order and a second with another). I have the following code on the On_Open event of the report. The report has no control source named in its Properties. Am I going about this incorrectly, because this opens the report with the correct data but does not sort the data?...
    See more | Go to post

    Leave a comment:


  • martin DH
    replied to Changing report source query at runtime
    Could one of you post an example of code for changing a report's record source on open?

    Thank you.
    martin
    See more | Go to post

    Leave a comment:


  • martin DH
    started a topic Some help explaining a snippet of code?

    Some help explaining a snippet of code?

    Could anyone help explain the following snippet of code? I'm not quite sure how it works. Thanks!

    [CODE=vb]Public Counter As Integer
    Private Sub Form_Load()
    If Me.CurrentRecor d > 0 Then
    DoCmd.GoToRecor d acActiveDataObj ect, "", acLast
    Counter = Me.CurrentRecor d
    DoCmd.GoToRecor d acActiveDataObj ect, "", acFirst
    Else
    MsgBox "There...
    See more | Go to post

  • martin DH
    started a topic Running Code Through a Loop?

    Running Code Through a Loop?

    Hello all,
    I'm looking for some help with what I believe will be a loop. I have the following code on a form that updates a field in a table and then prints a report for the current record. My form can be open with more than one record, however, and I would like this set of code to run for each record on the form. As always, many thanks for your tips!

    [CODE=vb]Private Sub cmdPrint_Click( )
    'Immediately prints one copy...
    See more | Go to post

  • martin DH
    replied to Sending Email Message in HTML from Access
    Thanks, Adezii, for the tip. That unfortunately still produces a plain text email message. I think that applies more so to if I was actually sending a database object with the email. Any other ideas?

    Thanks.
    See more | Go to post

    Leave a comment:


  • martin DH
    started a topic Sending Email Message in HTML from Access

    Sending Email Message in HTML from Access

    Hello all,
    I'm looking to send an email message from my database at the "click of a button." I've got that part worked out - the only thing is, it sends text only and I would like the message to include our company's fonts, colors, etc.

    So, anyone know of a way to have Access 2003 create this message in HTML verses the text only? Code below. Thanks in advance for any help!

    [CODE=vb]Private Sub cmdEmailLetter_ Click()...
    See more | Go to post

  • martin DH
    replied to Query Only Includes Current Year
    Thanks, Stewart. That makes perfect sense. I appreciate your thorough explanation as well. I've tested and it's working as it should.

    Thanks again,
    Martin
    See more | Go to post

    Leave a comment:


  • martin DH
    started a topic Query Only Includes Current Year

    Query Only Includes Current Year

    Hello,
    When I run this particular query I get some strange results - I think I know why but I'm not sure of how to correct.

    This query should pull records older (based on the RecdDt) than the number entered in a textbox on a form (frmAgedOptions ). When I enter "1" in the textbox on the form, all results return; when I enter any other number, the correct results return based on age, but only for the current year (i.e....
    See more | Go to post

  • martin DH
    replied to MDE file
    Megalog,
    First of all, I tried mirroring your directions above but must have missed something - the "new" mde was still the "old" mde after I ran the batch file.
    Here is my Batch text:
    Code:
    DEL "C:\Documents and Settings\bcraft\My Documents\Tax\*.mde /q
     
    copy "U:\Db\BAT DB.mde" C:\Documents and Settings\bcraft\My Documents\Tax /V /Y
     
    START /MAX "C:\Program Files\Microsoft
    ...
    See more | Go to post
    Last edited by martin DH; Feb 15 '08, 03:29 AM. Reason: Added batch text

    Leave a comment:


  • martin DH
    started a topic Combo Box to Change Preset Textbox

    Combo Box to Change Preset Textbox

    Hello,

    I have a unique situation, I believe. I have a form with unbound textboxes (frmEditReport) - most populate from a search query but one unbound textbox, txt_ReturnInfo, populates based on a selection the user chooses when logging in (code below). Basically, the user selects their office at login and the textbox will populate with the appropriate return mailing address when frmEditReport opens.

    I think this is...
    See more | Go to post

  • martin DH
    replied to Allow "Got Focus" to Work Only Once
    Thank you both for your advice and suggestions. With these ideas I developed an alternative solution that fulfills all of the requirements.

    First, yes frmResolution will be open. On this form, I locked the ResFileLocation textbox. I also added a command button that opens another form, frmLocation.
    [CODE=vb]Private Sub cmdLocation_Cli ck()
    On Error GoTo Err_cmdLocation _Click
    Dim stDocName As String
    ...
    See more | Go to post

    Leave a comment:


  • martin DH
    replied to "Data Type Mismatch" when opening Report
    Problem solved.

    The problem was due to the fact that my data had some null values and the functions I was using as control sources weren't set up to handle nulls.

    Sometimes, it's the simple things in life.
    See more | Go to post

    Leave a comment:


  • martin DH
    replied to Using AVG in Control Source
    FishVal,

    Thank you very much for breaking down the logic of your response - it always helps to see layperson's terms along-side the code!

    I knew taking the average of a text field made no sense, but I wasn't sure how to get around the fact that the fields could include "N/A." So I have done as you suggested and my report is calculating a printing correctly.

    Thank you!
    martin
    See more | Go to post

    Leave a comment:


  • martin DH
    replied to Using AVG in Control Source
    FishVal and missinglinq,

    I actually tried both suggestions and both return the same error: "Data type mismatch in criteria expression."

    I'm a little unfamiliar with this aspect - what about writing a query that calculates the average and having that query be the control source for the textbox?

    Any ideas are most appreciated - thanks.
    See more | Go to post

    Leave a comment:


  • martin DH
    replied to Using AVG in Control Source
    Thanks, FishVal; I want to look into your recommendation.

    I converted the datatype of Q4c to Number which deleted all "N/A" from the table, leaving some null values.

    Now, on my report, I would set the control source of the text box that was previously
    Code:
    =(Avg([Q4c]))
    to
    Code:
    =(Avg(Nz([Q4c], "N/A")))
    Is that correct?
    Thanks....
    See more | Go to post

    Leave a comment:


  • martin DH
    started a topic Using AVG in Control Source

    Using AVG in Control Source

    Is it possible to have this as a textbox control source:
    Code:
     =(Avg([Q4c]))
    when the field Q4c is formatted as a text field?

    The field Q4c can contain "N/A, 1, 2, 3, 4, or 5" so I think it must be formatted as text due to the "N/A"

    But I need to take the average of this field on a report. I tried and it worked once but not again (see post at http://www.thescripts.com/forum/thr...
    See more | Go to post
    Last edited by martin DH; Feb 8 '08, 01:13 PM. Reason: Better Title

  • To help clarify, here's what's going on:

    1) I have an Excel spreadsheet with survey results data, some of which is "number stored as text" (responses are 1-5, N/A).
    2) I imported this to Access as a new table (tblResults), then built the report I mentioned above.
    3) The report opens fine.
    4) I get a spreadsheet with new data but exact same format.
    5) I imported this to Access as a new table (tblResults)...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...