Results 1 to 5 of 5

Thread: Running Modules

  1. #1
    Join Date
    Jan 2004
    Posts
    106

    Unanswered: Running Modules

    i have the following module and i need to be able to make it run when a command button is pressed.

    Function Fines(Bookid)

    Get Data From database Base on BookID
    Date_Due_Back = dlookup("[Date Due Back]","Tablename","[BOOKID] = " & bookid)

    DaysLate = DateDiff("d",Date_Due_Back,Now())

    Select Case DaysLate

    Case 0 to 7
    Fvalue=0
    Case 8 to 14
    Fvalue=0.3
    Case 15 to 21
    Fvalue=0.6
    Case 22 to 28
    Fvalue=1
    Case 29 to 56
    Fvalue=1.5
    Case Else
    Fvalue=3
    End Select

    Fines=Fvalue

    Could do some More Cal

    End Function



    can somebody please hlep?!

  2. #2
    Join Date
    Jan 2004
    Location
    The Netherlands
    Posts
    421
    in the on click simply run it like so

    Sub Button_OnClick
    myTextbox = Fines(BookID)
    end sub

    Regards

  3. #3
    Join Date
    Jan 2004
    Posts
    106
    what is the on click?

  4. #4
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Originally posted by craig_dixon
    what is the on click?
    If you point the mouse to your Button and press the right mouse and select to write a code, you will then write a code for this button when it is clicked.

    Also you can see all events under the Properties tab/events

  5. #5
    Join Date
    Jan 2004
    Location
    The Netherlands
    Posts
    421
    Create a button on a form
    right click the button
    click properties
    In the properties window go to the tab events
    find the on click
    Click the ... button beside it....

    and select code from the list

    On click of a command button is the action which gets triggered when the button gets .... Uhm ... clicked....

    Regards

Posting Permissions

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