User Profile

Collapse

Profile Sidebar

Collapse
percman
percman
Last Activity: Nov 5 '13, 07:03 PM
Joined: Sep 9 '13
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Between my last post and your most recent reply, I did just that; moved the code about the employee error message to the beginning. It worked!

    Code:
    Private Sub SaveButton_Click()
    Dim rst As Recordset, db As DAO.Database
    
    Set db = CurrentDb()
    If ((Me![EMPLOYEE] + "") = "") Then
    MsgBox "You must select a name from the Employee dropdown to continue", vbInformation
    Exit
    ...
    See more | Go to post

    Leave a comment:


  • I tried something else in the mean time. I placed the code you mentioned BELOW line 17 and it stops the submit, plus if there IS a name it WILL submit. So that part works. One last crucial step - I am trying to create a message box that will say "You must have a name selected in the Employee area to continue", but how do I make that work? Here's what I wrote:

    Code:
        rst!EMPLOYEE = Me.EMPLOYEE.Value
        If ((Me![EMPLOYEE]
    ...
    See more | Go to post

    Leave a comment:


  • I understand what you're saying about line 17, but line 6 is currently showing "Set rst = db.OpenRecordse t("main")". Are you saying replace line 6 with what you're writing there, or ADD a line?
    See more | Go to post

    Leave a comment:


  • Code:
    'THIS IS THE CODE THAT SAVES THE OUTPUT TO THE MAIN TABLE
    Private Sub SaveButton_Click()
    Dim rst As Recordset, db As DAO.Database
    
    Set db = CurrentDb()
    Set rst = db.OpenRecordset("main")
    'MONDAY OUTPUT
    rst.AddNew
        rst!Day1 = "Monday"
        rst!ProjectMonday1 = Me.Combo1463.Column(0)
        rst!AFEMonday1 = Me.Text1455.Value
        rst!ProjectMonday2 = Me.Combo1465.Column(0)
    ...
    See more | Go to post
    Last edited by Rabbit; Oct 31 '13, 12:49 AM. Reason: fixed code tags

    Leave a comment:


  • Thanks Adezii!

    One thing that is a little tricky is that the code above is only a sample of the entire string. After "Me.EMPLOYEE.Va lue", there is a whole bunch of code that records other aspects - hours, percentage of time, etc. for all 7 days, and then there is yet more code that resets the entire form to blank. I tried to interpret what you wrote to go at the end of the entire string but an error came up "Update or...
    See more | Go to post

    Leave a comment:


  • Trying to make a form stop without a required name field

    I have a button at the bottom of a form that sends all of the information into a table. The information sent the table is useless without a name. The button is defined and all of the fields are going into the table without a problem, but I need to have a control that says it cannot be submitted without a name. The button is set up with an "On Click procedure, but I can't figure out how to write an If/Then statement that would prevent this. So...
    See more | Go to post
    Last edited by Rabbit; Sep 30 '13, 10:06 PM. Reason: Please use [CODE] and [/CODE] tags when posting code or formatted data.

  • But if it's comparing the last value entered in addition to the others, wouldn't have to be after update? How could it be a before update ifthe value has not gone in? Guess I'm still a little confused...

    Here's another similar situation. I have a button at the bottom of the form that sends all of the information into a table. The information sent the table is useless without a name. The button is defined and all of the fields are going...
    See more | Go to post

    Leave a comment:


  • percman
    started a topic Access form need critical stop VBA coding

    Access form need critical stop VBA coding

    I am extremely new to VBA and am trying to something that one would think would be easy. All I need is a way to create a stop in a form when a wrong entry is input. The form consists of hours per day, and three different areas where these hours are distributed. I have this code:

    *

    Code:
    Private Sub Text1470_AfterUpdate()
    
    Me.Text1474.Value = (Text1470 / HOURSMondayTotal)
    
    If Val([Text1467]) + Val([Text1469])
    ...
    See more | Go to post
    Last edited by Rabbit; Sep 9 '13, 09:04 PM. Reason: Please use code tags when posting code or formatted data.
No activity results to display
Show More
Working...