Search results

  1. B

    Force unique, set length field value OR exceptions

    Is there any way to force a field value to be unique and of a set length, but with exceptions? Let me explain... I have a text field in my table called "employee_number" and this value is always one of the following: NULL an 8-digit number the word "External" What I want to do is to force...
  2. B

    Enter Parameter Value when it's already declared...?

    Thanks Paul, that's worked. :) Much appreciated.
  3. B

    Enter Parameter Value when it's already declared...?

    I'm trying to update a SQL table using a form button, and getting an "Enter Parameter Value" textbox prompt when the value is already declared. Not sure what is wrong. I know the value is valid as I'm returning it in a MsgBox. Here is my code. Private Sub cmd_data_merge_Click() finish =...
  4. B

    Run-time error 3075

    I used CJ_London's suggestion and have this sql_search = "SELECT * from dbo_users where job_title not like '*N/A - ACCOUNT RENAMED*' and owner_name like '*" & Replace(search_text, "'", "''") & "*' order by surname asc, forename asc" Forms![frm_main2]![subfrm_main2_search].Form.RecordSource =...
  5. B

    Using Mid in a string

    Ignore me - I'm an idiot. I was doing an If/Else/EndIf and only including the values which matched a certain department. Obviously, all of those would now be the department name MINUS the leading characters, argggggggggggggggg! It's always nice discovering errors but does tend to make you...
  6. B

    Using Mid in a string

    Hmmm. This returns "123 Point 5 Finance and Accounting": trimmed_department = Mid(Trim(Replace(new_department, vbCrLf, "")), 1) This returns nothing: trimmed_department = Mid(Trim(Replace(new_department, vbCrLf, "")), 2) I'm at a loss!
  7. B

    Using Mid in a string

    The full department name (123 Point 5 Finance and Accounting).
  8. B

    Using Mid in a string

    Thanks Paul. Am I right in thinking it would look something like this? As this is returning a null value at the moment... trimmed_department = Mid(Trim(Replace(new_department, vbCrLf, "")), 13)
  9. B

    Run-time error 3075

    Thank you both. That's done the trick! :)
  10. B

    Using Mid in a string

    I'm trying to get a value from a spreadsheet to import into my MS Access database. Currently I am trimming the spaces/carriage returns from it but need to strip some more data from the value. Here is my code. trimmed_department = Trim(Replace(new_department, vbCrLf, "")) Example value...
  11. B

    Run-time error 3075

    I have a SQL search on the main page of my database which gives me run-time error 3075 "Syntax error" whenever my search_text value includes an apostrophe, e.g. "Susan O'Connor" Here's my code which is triggered when I hit search: sql_search = "SELECT * from dbo_users where job_title not...
  12. B

    Combining values in an expression using IIf

    THANK YOU Paul! As always you have been sooo helpful. :) I owe you one!
  13. B

    Combining values in an expression using IIf

    If the "organisation" field has the name of our organisation in it (Happy People Ltd) then they're internal. If not, they're external - we have about 20 other organisations who use our systems and they're all in the same database.
  14. B

    Combining values in an expression using IIf

    Hello all I'm trying to create a text box on a form which displays a value based on numerous criteria. Basically I manage a database of employees. Some are external employees, some are internal. Some have left the organisation, and some are still employees. I have two fields which need to...
  15. B

    Write Conflict when using datasheet view with search

    Just wanted to let you know I managed to resolve this after a colleague noticed that one of the events on the form was triggering an "edit" of the datasheet row. Added in an undo of the edit and it fixed the issue. Hurrah! Thanks everyone. :)
  16. B

    Write Conflict when using datasheet view with search

    Thanks AccessBlaster... I don't actually have any checkboxes in that table at all. Could you please give me a clue as to what I'm looking for? I have an AutoNumber field, a large number of Text fields, 4 x Number fields, 6 x Date/Time fields, a Memo field, and that's about it...
  17. B

    Write Conflict when using datasheet view with search

    Yes it is AccessBlaster.
  18. B

    Write Conflict when using datasheet view with search

    Thanks for that, Paul. I thought your second suggestion sounded a bit easier, so tried that, but I'm still getting the write conflict even when the subform doesn't allow edits?! Being an Access Amateur I'm not quite sure how to make the subform unbound, so am keen to get your latter suggestion...
  19. B

    Write Conflict when using datasheet view with search

    I have a few forms - one search form (frm_main_search) which uses a basic datasheet view as a subform (subfrm_main_search), and one form which I launch from the subform (via a double click event) for the user record - frm_user_record. If I search for a user, then select them from the datasheet...
  20. B

    Trimming whitespace after pulling data from an Excel cell

    That was the one! That fixed it. I realised it was doing it with my other values too, it just wasn't throwing up an error, but it was inserting the carriage return. I appreciate everyone's help! Thanks!
Back
Top Bottom