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...
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 =...
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 =...
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...
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!
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)
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...
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...
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.
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...
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. :)
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...
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...
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...
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!