From form to table back to form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jollywg
    New Member
    • Mar 2008
    • 158

    #1

    From form to table back to form

    I'm creating a database for a hospital, and i need a little help with the forms. I have the user enter in patient info (ie gender, weight) in one form, which stores it in a table tblPatient. Now i need to use the weight to perform some math in VBA whenever the checkbox chkTrauma is clicked.

    Thank you
    Matt
  • mshmyob
    Recognized Expert Contributor
    • Jan 2008
    • 903

    #2
    Put your code in one of the properties of the checkbox (usually On Click or After Update), but depends on when you want the code triggered.

    cheers,

    Originally posted by Jollywg
    I'm creating a database for a hospital, and i need a little help with the forms. I have the user enter in patient info (ie gender, weight) in one form, which stores it in a table tblPatient. Now i need to use the weight to perform some math in VBA whenever the checkbox chkTrauma is clicked.

    Thank you
    Matt

    Comment

    • missinglinq
      Recognized Expert Specialist
      • Nov 2006
      • 3533

      #3
      Like this:

      Code:
      Private Sub chkTrauma_AfterUpdate()
      If chkTrauma Then
        'Code here if box is checked
      Else
        'Code here if box is unchecked
      End If
      End Sub

      You probably need to include the Else in case the operator accidentally marks the record as a trauma patient, and then realizes they made a mistake. You'd use the Else clause to undo whatever calculation you'd run when it was checked.

      Welcome to bytes!

      Linq ;0)>

      Comment

      • Jollywg
        New Member
        • Mar 2008
        • 158

        #4
        Thanks for the help that did it.

        Comment

        Working...