|
-
Jul 31st, 2008, 09:24 PM
#1
Thread Starter
New Member
Conditional Statements
I have 3 fields on a form. If any of theses fields contain a value then I want to write a record to a database. I've got all the logic down to write to the database, but I'm having problems with a complicated IF Then statement.
The three fields are stored in variables - strNewPay, strNewAcct, strNewTitle. I only want to write to the database if any of these fields contain data. It can be any combination of these 3....1, 2, all, etc.
I can make it work if all fields contain a value, but I'm struggling to get it to work with all the possible combinations.
If strNewPay <> "" and strNewLaborAcct <> "" and strNewTitle <> "" and Rs.Recordcount = 0 then
Rs.Addnew
Any advice would be greatly appreciated. I've tried many different If Then statements but can't seem to get it right.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|