Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

password problem and math problem

thinkhardthinkhard Member Posts: 4
I have two separate problems I am trying to work out to finish a project i am working on.

The first one deals with math between bound text boxes on a form. I have a table set up with 5 fields (ProductDescription, ProductID, PriceEach, Quantity, and Total). My boss wants the database to store all five values. Since some of our employees have been having trouble with calculating the total price if there is more than 1 item I want to make total calculated automatically. I want access to multiply PriceEach and Quantity and store the value in Total. I have tried doing it with expression builder but it doesn't seem to work. Do I need vbcode to make this happen?

The last problem has to do with password protection. There is a form where employees fill out a report. Supervisors have the same form but are given a check box (yes/no) to indicate if the report is approved. I have a simple inputbox function right now, where the supervisors enters a password and there name is placed in a text box to indicate who approved the report. The problem is that we have more than one supervisor and I don't know how to get the imputbox to accept more than one password.

This is the code I am using:
Private Sub Approved_Click()
x = InputBox("Please Enter Your System Assigned Password To Approve This Report:", "Authentication Required To Proceed")
If x = "mangosquash" Then Approved_By = "MikeMika"
If x <> "mangosquash" Then Approved_By = "ERROR"
End Sub

I can't add more than one value for x and can't figure out how to add another variable to the inputbox. Any advice?

Comments

  • dokken2dokken2 Member Posts: 532
    : I have two separate problems I am trying to work out to finish a
    : project i am working on.
    :
    : The first one deals with math between bound text boxes on a form. I
    : have a table set up with 5 fields (ProductDescription, ProductID,
    : PriceEach, Quantity, and Total). My boss wants the database to store
    : all five values. Since some of our employees have been having
    : trouble with calculating the total price if there is more than 1
    : item I want to make total calculated automatically. I want access to
    : multiply PriceEach and Quantity and store the value in Total. I have
    : tried doing it with expression builder but it doesn't seem to work.
    : Do I need vbcode to make this happen?
    :
    : The last problem has to do with password protection. There is a form
    : where employees fill out a report. Supervisors have the same form
    : but are given a check box (yes/no) to indicate if the report is
    : approved. I have a simple inputbox function right now, where the
    : supervisors enters a password and there name is placed in a text box
    : to indicate who approved the report. The problem is that we have
    : more than one supervisor and I don't know how to get the imputbox to
    : accept more than one password.
    :
    : This is the code I am using:
    : Private Sub Approved_Click()
    : x = InputBox("Please Enter Your System Assigned Password To Approve
    : This Report:", "Authentication Required To Proceed")
    : If x = "mangosquash" Then Approved_By = "MikeMika"
    : If x <> "mangosquash" Then Approved_By = "ERROR"
    : End Sub
    :
    : I can't add more than one value for x and can't figure out how to
    : add another variable to the inputbox. Any advice?
    :


    for 2nd problem, use a case statement in place of if..then -

    Select Case x
    Case "pwd1:": approveby = "person1"
    Case "pwd2:": approveby = "person2"
    Case "pwd3:": approveby = "person3"
    Case Else: approveby = "error!"
    End Select
Sign In or Register to comment.