Results 1 to 11 of 11
  1. #1
    Join Date
    Mar 2007
    Posts
    91

    Unanswered: Setting up a flag/ follow up

    Hi guys.

    i want a flag 2 go off within 5 days of doin a certain task (ie accepind a new clients' details & send some1 a mail aftawards, make an order via mail) Reason bein i wanna do a follow up and c if d requeted task has been attended to

    Ma code:

    Option Compare Database
    Function Follow_up()
    Dim Follow_up As String
    Dim duration

    Follow_up = "SELECT Customer_contact_details.* FROM Customer_contact_details WHERE Customer_contact_details.Date<Now()-5;"
    MsgBox ("Please do a follow up on " & [Forms]![molo]![customercode] & ", " & [Forms]![molo]![Unique_ID] & ", " & [Forms]![molo]![CustomerName])

    End Function

    problem is i don't know where to put ma code coz i did it in a module and calles it in a macro as a function (runcode) but it's complainin dat it can't find d requested function

    Pls kindly advise

    Noks

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    If you stick it in a module you can call it throughout your project by using:

    Call Follow_Up()
    George
    Home | Blog

  3. #3
    Join Date
    Mar 2007
    Posts
    91
    Thanks 4 respondin GeorgeV. I've tried yo suggestion but it's lookin 4 "Follow_up - macro instead of module d 4 it's complainin dat it can't find it

    Noks

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    why not run a query that sends the results to a form, conceivably you could even have it ahs a lookup/combo box within you data entry /manipulations form

    if you have an unbound list box whose reowsource is
    "SELECT Customer_contact_details.* FROM Customer_contact_details WHERE Customer_contact_details.Date<Now()-5 order by Customer_contact_details.Date ASC"

    then place some code behind the list boxes on click event (so that when you seelct the record it automatically does something (either moves to that row in the current form or opens another form that does your follow up action

    ...if you go down that route then remember to requery the row source each time you have set you follow up flag.
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Quote Originally Posted by georgev
    If you stick it in a module you can call it throughout your project by using:

    Call Follow_Up()
    Drop the Parens... My bad.
    - Make sure your module is NOT called Follow_Up.
    - perhaps rename your function so that the name does not contain an underscore.
    - Meh.
    George
    Home | Blog

  6. #6
    Join Date
    Mar 2007
    Posts
    91
    Thanks

    tworked well wit d parens... but i just had 2 rename d module...
    D only prob @ d moment is dat if i use val = 0 and if i take it out it display ma codin "select..." so i need 2 fix dat, i had a similar prob b 4 now d prob is i can't remember what i did 2 fix it

  7. #7
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Quote Originally Posted by noks
    tworked well wit d parens... but i just had 2 rename d module...
    D only prob @ d moment is dat if i use val = 0 and if i take it out it display ma codin "select..." so i need 2 fix dat, i had a similar prob b 4 now d prob is i can't remember what i did 2 fix it
    Translation please?
    What does "D", "dat", etc mean?

    I have no idea what you mean by
    Quote Originally Posted by noks
    if i use val = 0 and if i take it out it display ma codin "select..."
    George
    Home | Blog

  8. #8
    Join Date
    Mar 2007
    Posts
    91
    if i use code:
    MsgBox ("Please do a follow up on " & val(Follow_up))

    Results = Please do a follow up on 0

    and if i use
    MsgBox ("Please do a follow up on " & (Follow_up))

    Results = Please do a follow up on ""SELECT Customer_contact_details.* FROM Customer_contact_details WHERE Customer_contact_details.Date<Now()-5;"

    But i want it 2 display ie Customer name, number, contact etc

    Thanks
    Noks

  9. #9
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    then consider doing what was suggested in post 4
    place a combo or list box containing the items needing followup

    ..its pretty trivial.. it keeps all the info together, it simplifies you design.. there just the one form.
    I'd rather be riding on the Tiger 800 or the Norton

  10. #10
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    So basically you're saying that:
    (Follow_up) = "SELECT Customer_contact_details.* FROM Customer_contact_details WHERE Customer_contact_details.Date<Now()-5;"
    Which is correct (see your first post)
    You need to assign the values of Customer name, number, contact etc to variables. Is the data you want displayed in the messagebox on the active form?
    George
    Home | Blog

  11. #11
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    In fact, your first post also said:
    Quote Originally Posted by noks
    MsgBox ("Please do a follow up on " & [Forms]![molo]![customercode] & ", " & [Forms]![molo]![Unique_ID] & ", " & [Forms]![molo]![CustomerName])
    Which is probably what you wanted. Just read what you put again!
    George
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •