Search results

  1. G

    Time Formats

    For anyone who comes across this, I finally figured it out. You have to create a module in vba with the following code: Function FormatDecimalTime(DecimalTime As Single) As String Dim lngHours As Long Dim sngCalculated As Single sngCalculated = DecimalTime / 24# lngHours =...
  2. G

    Lock Specific Records

    Ok I just completely reentered the code from scratch and it's now working, thanks.
  3. G

    Lock Specific Records

    Hi all, I want to lock an individual record when a certain check box is ticked so it can't be edited again. I've tried setting the form to read only when this check box is ticked on the form OnCurrent event, but this locked every record and I had to remove the code to untick the check box and...
  4. G

    Time Formats

    the textbox is formatted as Short Time, but I changed the format on the table to number, and then entered that code into the format box, but it just had a lot of ####'s when I opened form view.
  5. G

    Current User List Form

    Yeah that's got it! Thanks a lot for that!
  6. G

    Current User List Form

    Yeah the ID matches the ID of the Username.
  7. G

    Current User List Form

    Ok now I've got it vaguely working, I managed to get it working based on the FName field rather than the UserID. It's not ideal but it's a start. The UserID field is an autonumber, but surely that shouldn't make a difference? Any ideas? Thanks for all the help so far!
  8. G

    Current User List Form

    Yeah I hope so, it's still not having it though. Currently I have this; DoCmd.RunSQL "UPDATE tblUser SET tblUser.[Logged In] = TRUE WHERE tblUser.UserID = '" & Forms!frmLogin!cboUser.Column(0) & "'" after the open navigation code, and nothing is updating. If I move it anywhere else, the login...
  9. G

    Current User List Form

    Ok so I changed it to WHERE tblUser.FName = 'someone's first name'" and that works fine. I tried changing it to a specific UserID and that didn't work (the Login form wouldn't minimise and the Nav wouldn't open). I then tried it as '" & Me.cboUser.Column(1) & "'" and that also didn't work...
  10. G

    Time Formats

    1. Quantity is entered in relevant box (Total, Machine, Bench or Inkjet) 2. Production Department is chosen (Machine, Bench, Machine and Bench, Inkjet) 3. Run Rate is entered manually (this is a value of X packs per hour) 4. There are 4 calculations, 1 for each production department. The...
  11. G

    Current User List Form

    Nope, that still hasn't got it for some reason. I've tried both TRUE and 1 with no avail and I've tried moving code the any of the places it can be and still it doesn't work :confused:
  12. G

    Time Formats

    The calculated field isn't being stored in the table, just the result of the calculation, which is what I need to store as DD:HH:MM EDIT: I should also mention, this is a Time Elapsed field, so there is no Start Date/Time and End Date/Time that I can work out, as I would need to work out the...
  13. G

    Time Formats

    Hi all, I need to store the hours a job will run for on my form. There are 4 calculated fields, each based on production department. The HOURS field will then calculated the time based on what production department is selected, and then using the relevant calculated field. However it's...
  14. G

    Current User List Form

    No luck with it yet =[ I'm leaving work now as well so I'll have to check back tomorrow, but currently the whole code for the login button is this; Private Sub Login_Click() 'Check that User is selected If IsNull(Me.cboUser) Then MsgBox "You need to select a user!", vbCritical...
  15. G

    Current User List Form

    I've tried your suggestion, and this is my code; DoCmd.RunSQL "UPDATE tblUser SET [Logged In] = 'Yes' WHERE UserID = '[cboUser.Column(0])'" Unfortunately it doesn't update the field in my table, whether it's a check box or a yes/no field as I originally had. Also there are DoCmd.OpenForm and...
  16. G

    Current User List Form

    Hi all, thanks for the help so far. My database loads up into a login form, a user enters their username and password and then the navigation form opens with certain things enabled or disabled based on the users access level. What I'd like to do is have the login form tick a "Logged In" box...
  17. G

    Exclude object from Read Only?

    Thanks for that guys, that's got it! I've done it on Form Load, as there won't be any closed records in my form (well at least right now anyways, who knows when it'll change!) Thanks for the help!
  18. G

    Exclude object from Read Only?

    I've tried this code; Private Sub Form_Open() If [Forms]![frmLogin]![Level] = "Guest" Then Me.JOBNO.Enabled = False Else Me.JOBNO.Enabled = True End If End Sub but now I get an error saying "Procedure declaration does not match description of event or procedure...
  19. G

    Exclude object from Read Only?

    Thanks for the replies, but I can't see how or where to put this information, any help? I've tried putting this in the On Open event of a form, but it now prevents the form from opening again.
  20. G

    Exclude object from Read Only?

    I've tried this but for some reason, when I add If Forms![Login]!AccessLevel = Guest Then cbo1.enabled = false on the Form Open event, it prevents the form from opening when I either click on the button on my navigation form to open it, or go into the navigation pane and try to open it from there.
Back
Top Bottom