Recent content by Gaddy

  1. G

    Disable Button When Text/Combo Fields Are Null

    Hi, If the user starts to fill out the form and realises that they've put the wrong info in, it's easier to just press 'Esc' and start over. EDIT: I've fixed by adding: Private Sub Form_Undo(Cancel As Integer) Me.cmdSave.Enabled = False End Sub
  2. G

    Disable Button When Text/Combo Fields Are Null

    Thanks, but the save button is still greyed out after updating cboUserID... EDIT: Got there in the end. Had to put the code into every AfterUpdate for each required field which is stated in the array. I'm learning. As I declared all my comboboxes and textboxes as a array (as one), if one is...
  3. G

    Disable Button When Text/Combo Fields Are Null

    Sorry, I've only had three hours sleep today. The save button is greyed out regardless of the fields being filled in.
  4. G

    Disable Button When Text/Combo Fields Are Null

    Apologies, I've tried it again and it does work. I can't get Lagbolt's to work though. Option Compare Database Property Get MyRequiredControls() As Variant MyRequiredControls = Array(Me.cboUserID, Me.cboUtilityID, Me.txtErrorDate, Me.cboErrorID) End Property Function...
  5. G

    Disable Button When Text/Combo Fields Are Null

    Please disregard.
  6. G

    Disable Button When Text/Combo Fields Are Null

    To be honest, this was copied from elsewhere. All I want to do is make an easier way to disable the save button by putting in the tag rather than typing code each combobox/text box... How can I adapt that code - can you give me an example? I think I am half-way there: Private Sub...
  7. G

    Disable Button When Text/Combo Fields Are Null

    Hi All, On a form, I want to disable the save button, 'cmdSave' whilst the form's mandatory fields have been left blank. I've put in a smart tag, called, 'Req' against each required field and have used the following code on the forms current event. Private Sub Form_Current() Dim ctl As...
  8. G

    Error Message On Creating Duplicate Record

    That doesn't appear to work... Run-Time error 2467 The Expression you entered refers to an object that is closed or doesn't exist. EDIT: Ignore that, it was because the 'docmd.close' was before the 'MsgBox' part.
  9. G

    Error Message On Creating Duplicate Record

    Thanks, this worked for me. I need to trap the run time error that occurs. Reference my OP, how do I get a message box to appear displaying something like "Payroll ID n already exists" where n is the 'PayrollID' of the duplicate record. (Is it possible to combine a value from a certain control...
  10. G

    Error Message On Creating Duplicate Record

    Hi, The bold section above seems to comment out... Where do I put this code (I've temporarily put it under the form) and do I have to do anything else with it?
  11. G

    Error Message On Creating Duplicate Record

    Hi, The table is already set up in this manner.
  12. G

    Error Message On Creating Duplicate Record

    Hi, I need to be able to produce an error on a form where the user attempts to create a new user that already exists. The error needs to be produced when the save button is clicked. Please see below for the existing code on my save button which exists in form, 'frmAddEditUser': Private Sub...
  13. G

    Search Form & Error Messages

    I'm going down a different route now. Rather than opening frmUser, I've created a new form that displays the relevant users in a continuous form so the records are laid out like a spreadsheet. Then on double click of the relevant record it will display that user in frmUser. Just need to edit...
  14. G

    Search Form & Error Messages

    Hi Bob, The form, 'frmUser', I am using to add a new user as well as edit an existing one. The Location and Manager comboboxes are cascading combo boxes, so I only get a relevant selection of Managers based on a certain Location. That code is in there because if I am adding a new user and...
  15. G

    Search Form & Error Messages

    I've just realised that the two 'John Does' don't have a manager ID assigned to them. If you assign them one, then search for 'Doe', it won't return the Manager name if the Location ID for that manager is anything other than 1. EDIT: If you enter the manager ID of say 3 for the second John Doe...
Top Bottom