User Profile

Collapse

Profile Sidebar

Collapse
Paulo357
Paulo357
Last Activity: Jun 7 '12, 07:36 AM
Joined: May 23 '12
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • OK
    I have now gone down the path of trying to create a Public Function to get the value from Query PB7 and plug that answer [which is "May"] into my line of text.
    Here is my code so far:
    Code:
    Option Compare Database
    Option Explicit
    Public strgOutPut As String
    Public QueryMonth As Variant
    Public Function GetGlobal(VariableType As String) As Variant
    Select Case VariableType
    ...
    See more | Go to post

    Leave a comment:


  • There are many examples on MS Web site, that you can educate yourself from.. here is a starting point
    Code:
    =DLookUp("[LastName]", "Employees", _
          "[EmployeeID] = Form![EmployeeID]")
    Generally you wont have much luck using the Wizard as it never compiles the code correctly or picks up the quotes when fields need it
    See more | Go to post

    Leave a comment:


  • Then what happening is your Form is collating the entire database for the records you require. Try having the Form make a filtered record set to a temporary table a link to that
    See more | Go to post

    Leave a comment:


  • You're starting at the end product. You first need a Table to hold the purchases. It will need to hold the ID of the individuals and ID of the Products and anything else you want to report on like date? or Value?. You then need to create a Form to capture the purchases by individuals. Use combo boxes to get Names & Products from the respective Tables
    See more | Go to post

    Leave a comment:


  • If you anticipate the user will want to go back to Form1 why not minimize it or hide it. close it off Form2 close function
    See more | Go to post

    Leave a comment:


  • Try DLookUp to pull what you want from the second Form
    See more | Go to post

    Leave a comment:


  • I have created what I want to see as a result in a Query, ie: May
    Code:
    SELECT Max(Format([MaxOfShootDate],"mmmm")) AS [Month]
    FROM PB3
    WITH OWNERACCESS OPTION;
    Is there any what to adapt this to run in my Function in place of
    Code:
    dtRank = DMax("MaxOfShootDate", "PB5")
    I tried this which didn't work
    Code:
    Set dtRank = (Format("MaxOfShootDate",
    ...
    See more | Go to post

    Leave a comment:


  • Hi Marc
    Thanks for the reply
    Your code returned the same answer as mine = April.. I need the answer to equal May.
    I checked the Query PB5 and it contains April and May dates.. any ideas?
    See more | Go to post

    Leave a comment:


  • Extract max date and use the value in a line of code

    Iam a complete novice to writing code so I started with a snippet of code that produced what I wanted and have been add to it and modifying bits to get where I want to be.. so my code maybe a little disorganized..s orry.

    I have a MS Access Function which ranks a Queries results and is working fine. I have been able to add text to the beginning of the output script. I am now trying to insert a date into the text. Specifically I want...
    See more | Go to post

  • Thanks you
    I was entering my code on the wrong line. I left line 22 as it was and added to line 23 the following amendment and it worked.
    Code:
    Mid(strRank, 3) & "." & "%L%LOpen after 6:00 P.M."
    See more | Go to post

    Leave a comment:


  • Ahh, thank you that helped a lot.
    Ive been tinkering with trying to remove the new line between the scores and the postscript entry and including a full stop after the scores
    Line 22
    Code:
    ScoreRankingTotal = Replace(strRank, "%L", ". ")
    This is giving me two full stops
    I cant find the correct way to get one full stop and a single space before the postscript
    Any thoughts?
    regards...
    See more | Go to post

    Leave a comment:


  • Hi NeoPa
    Thanks for the help...
    I pasted your code into my module and it showed an error on line 22. That entire line was red. Ive never seen %L%LOpen and "%L" code in MS Access before I may not be running the appropriate References to handle it.. But Iam interested to give it a try as no one else is helping just now.
    Thanks for pointing out the indenting thing.. I didn't know that and I will try to implement it as I often...
    See more | Go to post

    Leave a comment:


  • Thanks NeoPa. Sorry thought I was being succinct. the code ran but didnt add the last line "Open after 6:00pm". re your code that did remove the trailing ";" thanks. I had to change the last reference from StrRank to ScoreRankingTot al. But it adds a blank line between the scores ending [now without a ; but I see now I'll need a fullstop. any ideas?
    all the code looks like this now
    Code:
    Function ScoreRankingTotal(ByVal
    ...
    See more | Go to post

    Leave a comment:


  • ADezzi
    I see your suggesting removing the trailing ;
    Code:
    strRank = Left$(strRank, Len(strRank) - 1)  'Remove Trailing ';'
    This did not work .. Iam still interested in getting that right if you can have a second look please
    See more | Go to post

    Leave a comment:


  • Thanks SmileyCoder that worked
    See more | Go to post

    Leave a comment:


  • Sorry for not making it clear. This code acts on a Query to format up a list of members scores for the local newspaper. I have a block of common text I place in the beginning of each write up.
    It is:
    "Members scores for 22/05/2012 out of a possible 200.020 were:" The code produces a line that can be copied which reads ...
    Members scores for 22/05/12; out of a possible 200.020 were: Rick Ruiterman 199.014; Paul Abbot 199.006;...
    See more | Go to post

    Leave a comment:


  • Apologies for my limited understanding of the terminology. Line 22 is blank, right? so I added your line 1 there.. Closed and Saved however the result was unchanged, I got the same when I tried your suggestion line 2. Am I confusing 'modify' with 'add'
    See more | Go to post

    Leave a comment:


  • Paulo357
    started a topic Inserting a Fixed Block of Text into a Procedure

    Inserting a Fixed Block of Text into a Procedure

    Currently this Module works placing "Members scores for 22/05/2012 out of a possible 200.020 were:" before the scores.
    I would like to add a post script after the scores " Open from 6pm" if anyone can help...


    Code:
    Function ScoreRankingTotal(ByVal dtRank As Date, ByVal boolRanked As Boolean, Optional intTop As Integer = 0) As String
    Dim qdf As QueryDef
    Dim rs As Recordset
     
    Dim
    ...
    See more | Go to post
No activity results to display
Show More
Working...