Recent content by krowe

  1. K

    function - can a string be an optional variable?

    Ok, must be something else wrong. The code doesn't run, it fails when I get to the first ismissing bit, so I read a bit and thought that may be the issue. When it gets to that line I get the error cannot find field " referred to in your expression... I know the field doesn't exist, and I...
  2. K

    function - can a string be an optional variable?

    I am amending some Code I found online for an audit table, I need to store additional information in the table that is associated with some forms but not others. I have researched about putting optional variables in, but I read this only works with the type VARIANT. Is there a way to make a...
  3. K

    How to better handle duplicate entry error

    still... I've learned a lot about write a query in vba today at least!
  4. K

    How to better handle duplicate entry error

    The fix worked great, thanks! I will have a look at using a query, I suppose the advantage is I wouldn't have to do the lookups as the tables would all be in the query... Wish i'd though of that!!!
  5. K

    How to better handle duplicate entry error

    what do you mean?
  6. K

    How to better handle duplicate entry error

    Sorry, It does need to tidying up and instruction... frmMain is just joining User to a Device and a Sim, so if you change the control cboDeviceID from Device 2 to Device 1 you should get the error (the erroneous code is on the before update of this control). Thanks Kev
  7. K

    How to better handle duplicate entry error

    Sorry In frmMain, try changing Device2 to Device1 (on the first record), then click yes to move the device to the current user, it gets stuck when it tries to remove the device from the previous user. Thanks Kev
  8. K

    How to better handle duplicate entry error

    Hi That's simplified things a lot, thanks for that steer. I have changed it into that format, now I'm back to the errors in the query syntax, specifically the one to make the existing device null, before putting the device against the current record. I have attached the DB...
  9. K

    How to better handle duplicate entry error

    Hi I think I'm getting closer, just having some difficulties with my if, then elses. this is where I'm up to but I get a else without if compile error (in red) Dim ExistingDevice As String Dim CountOfDevice As String Dim ExistingJoin As String Dim ExistingUser As String Dim...
  10. K

    How to better handle duplicate entry error

    have just tried this too, but getting same errors: Private Sub Device_BeforeUpdate(Cancel As Integer) Dim ExistingDevice As String Dim CountOfDevice As String Dim ExistingJoin As String Dim ExistingUser As String Dim ExistingUserName As String Dim Msg, Style, Title, Help, Ctxt, Response...
  11. K

    How to better handle duplicate entry error

    Hi Thanks for your help so far, I think I have got a little further, but getting errors with this: Private Sub Device_BeforeUpdate(Cancel As Integer) Dim ExistingDevice As String Dim CountOfDevice As String Dim ExistingJoin As String Dim ExistingUser As String Dim ExistingUserName As String...
  12. K

    How to better handle duplicate entry error

    Just realised my code doesn't work if I delete the device.. think I may need another if to account for this.... The Set Device = Null isn't working either :(
  13. K

    How to better handle duplicate entry error

    Hi I have done lookups in my table, I know this is frowned upon, although I must admit I don't know why... I have come up with this code, looks a bit tatty, but seems to be doing the trick, wonder is there is a way to simplify it Private Sub Device_BeforeUpdate(Cancel As Integer) Dim...
  14. K

    How to better handle duplicate entry error

    Hi I have a number of indexed (No Duplicate) fields in my table as I want to enforce a 1-1 relationship in the data. They all lookup values in other tables. When I user tries to put a duplicate entry in the database I'd like a message to pop up saying 'This entry is already associated...
  15. K

    Display different subform depending upon which control is clicked

    I just thought it would be good a good user experience if it was dynamic like that, the alternative would be to show all the subforms at the same time (maybe in tabs), but I liked the idea of clicking the box to see the related data. Should I do tabs and have the on click changing the tab that...
Back
Top Bottom