A family of Microsoft relational database management systems designed for ease of use.
First - above you mention " move the reference to the C outside of the quotes" - I don't understand what the "C" means - can you explain?
Second - this code is applied on the Contacts page - so the statement above is what I used - and you are correct! - the CUSTID is a text field so I used the single quote version you sent for that.
I continue to get an invalid argument error - so perhaps it's not seeing the string as a value yet?
My goal for keeping the forms/tables unbound was for these reasons - from another - so I can protect the cleanliness of the data before it's committed to the table - perhaps apply required constraints or checks for existing data before it's inserted to a record. Also so that should there be a future enhancement I can apply a new set of code and link to the existing data tables rather than need to export/import the records into a new 'bound' application. Also - in the event the code gets 'hosed' somehow I can just take the tables and set it up with a 'clean' set of executables. Is that in your opinion 'legitimate' for using unbound forms? I would like to understand your opinions on this area too! Thank you very much.
First, regarding "C outside the quotes": I have no idea what happened to what I thought I wrote! I meant to say, "move the reference to the form control outside the quotes". In other words, your reference to Forms!CUSTOMER!CUSTID.
Second, you say you are getting an "invalid argument error". Is that a different error from what you were getting before? I just noticed this, which is a change from the code you had previously posted:
Set rs = Db.OpenRecordset(strSQL, dbOpenDynaset, dbQUpdate)
Where did "dbQUpdate" come from? That has no business in a call to OpenRecordset! It's a QueryDefType constant. Why did you change the code to include that? Either you should use this:
Set rs = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset, dbReadOnly)
... if you want the recordset to be read-only, or just this:
Set rs = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)
... or even this:
Set rs = CurrentDb.OpenRecordset(strSQL)
... if you want the recordset to be editable.
Finally, regarding reasons for using unbound forms: I don't think your reasons are very good. First, any essential requirements on the data can and should be built into constraints on the table, either through validation rules or (in Access 2010 or later) table macros. Such constraints remain with the tables and are independent of the front-end.
Second, bound forms give you *amazing* ability to validate data up front, through control validation rules, control BeforeUpdate events, and form BeforeUpdate events. The BeforeUpdate events give you the ability to check anything you want and display nice messages to the user, so why not use that?
I don't understand your concern about problems related to code being "hosed". If your code is damaged, you just create a new front-end and attach it to the same tables. For a multi-user application, it's standard practice to split the application into a back-end database containing only the tables and a front-end database containing everything else, with linked tables pointing into the back-end. If you're worried about code being "hosed", you can do this even with a single-user application. That way your front-end can be totally trashed, and the back-end tables are still unchanged, and you can experiment with different versions of the front-end.