Hi guys!
I'm brand spanking new to Access...so please, throw this dog a bone!
My problem:
I have a form with unbound fields. Reason for this is so that I can validate the data before writing it to the table. So when the "save" button is clicked, all fields are verified, and only when all is right the data is saved to the table.
I have searched for code, and I have tried it, but ...
Welcome to the forums.
I've used an approach similar to this in past projects. What I did was to generate an Append Query in VBA based on the user-input, and then ran that. If you need help writing SQL in VBA, I'd have a look at Martin Green's site .
HTH
On small apps, I use the bound approach and just do the validation in the BeforeUpdate and Cancel it if there is an issue.
Other than that I use VBA recordsets (DAO) to write to the appropriate table on SAVE.
Code:
Sub SaveRecord()
<Validation Commands>
Dim RS as Recordset
Set RS = CurrentDB.OpenRecordSet("<SQL to your Table and Record>")
RS.Edit (or RS.AddNew if it's a...
Similar to ST, I use functions to read/write retrieve data to/from the unbound forms. But I don't put the functions in the form (and thus, can't use me.controlname) and I reference the form itself to read/write to the data fields. Utilizing the IsloadedForm function (you can find this module in the code bank) I then use the same function to determine which form to read/write to.
For ...
Quote:
Originally Posted by myle
My Rule is the Table hold the validate less coding needed also when you add a new form showing differance info the validate rule are always there.
I really don't like doing this and wouldn't recommend it. Especially since validation rules can change and this can be a nightmare to ...
Hello,
Please answer the question asked.
I originally created tables in which a form was feeding off. However I needed the form to use some arithmetic so I changed the Control Source in order to run the Expression.
Now the data from the form will not update in the table because it is not linked anymore...
HOW DO I HAVE USE THE EXPRESSION IN THE FORM AND THEN HAVE THE DATA ...
Quote:
Originally Posted by chigley3
Please answer the question asked.
Since you're new to the forums, I'd suggest having a look at our FAQ .
The question has been answered, with many options offered and often with more than adequate information provided.
Besides that, I think there are more than a few ...
Quote:
Originally Posted by chigley3
Hello,
Please answer the question asked.
I originally created tables in which a form was feeding off. However I needed the form to use some arithmetic so I changed the Control Source in order to run the Expression.
Now the data from the form will not update in the table because it is ...
chigley3, I apologize for my confusion in the previous posts. It is the ControlSource, NOT the SourceObject that you want to put the expression. I re-read one of my previous posts and I'm sorry about getting these mixed up.
If it is easier to use the expression in the query I dont mind. I am trying to put the expression in the criteria box for example =[labour rate]+[labour time] = labour cost the expression is not working in the query? how could something so simple be so complicated?
Quote: Originally Posted by chigley3 Please answer the question asked. Since you're new to the forums, I'd suggest having a look at our FAQ . The question has been answered, with many options offered and often with more than adequate information provided. Besides that, I think there are more than a few people around these forums who have qualms with storing calculated fields (it's generally a frowned upon practice).
If it is easier to use the expression in the query I dont mind. I am trying to put the expression in the criteria box for example =[labour rate]+[labour time] = labour cost the expression is not working in the query? how could something so simple be so complicated?
chigley3, I apologize for my confusion in the previous posts. It is the ControlSource, NOT the SourceObject that you want to put the expression. I re-read one of my previous posts and I'm sorry about getting these mixed up.
On small apps, I use the bound approach and just do the validation in the BeforeUpdate and Cancel it if there is an issue. Other than that I use VBA recordsets (DAO) to write to the appropriate table on SAVE. Code: Sub SaveRecord() <Validation Commands> Dim RS as Recordset Set RS = CurrentDB.OpenRecordSet("<SQL to your Table and Record>") RS.Edit (or RS.AddNew if it's a new record being...
Quote: Originally Posted by klompZA I have a form with unbound fields. Reason for this is so that I can validate the data before writing it to the table. There are few valid reasons for using unbound forms in Access, and the reason you give is certainly not one of them ! I wish a pox on whoever keeps perpetuating this absurd notion! Using unbound forms for data entry means that you are forfeiting at least half of the advantage in using a...
Quote: Originally Posted by klompZA I have a form with unbound fields. Reason for this is so that I can validate the data before writing it to the table. There are few valid reasons for using unbound forms in Access, and the reason you give is certainly not one of them ! I wish a pox on whoever keeps perpetuating this absurd notion! Using unbound forms for data entry means that you are forfeiting at least half of the advantage in using a...
Related threads on "dBforums - Database Support Community":
Thread profile page for "Unbound fields to table" on http://www.dbforums.com.
This report page is a snippet summary view from a single thread "Unbound fields to table", located on the Message Board at http://www.dbforums.com.
This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity