cheuschober
Muse of Fire
- Local time
- Yesterday, 23:14
- Joined
- Oct 25, 2004
- Messages
- 168
Hi! Today's ponderance is a fun one.
I have a form to add an account to our database as a valid account (frmAccountSetup).
On this form are several controls to add valuable information about the account (startup date, address, etc) to a table that holds that information (say tblAccounts). But when an account gets added to the system we also need to add a paycode and an expense code for that account to their respective tables (tblExpenseCodes and tblPayCodes). Not all paycodes or expensecodes are bound to an account, however, so it's not as simple as I would like it to be.
The paycode and the expensecode are the same short text string (assigned an autonumber when they hit the table) populated from a control (ctlNick) on the form in question, frmAccountSetup.
This much I can set up. Here is where I'm somewhat lost:
What I would like is for a user to be able to fill out the data for the account setup and click an 'update account' control that first checks to see that all the required fields have been filled for the first table tblAccounts, then verifies that the ctlNick (short text string) is NOT a duplicate of existing paycodes or expense codes and then appends the ctlNick value to tblExpenseCodes and tblPayCodes, finishing with a succesful completion msgbox.
I'm not certain how to a) tell the system to first check for rule violation and required fields across multiple tables and cancel and return an error message if it fails and b) how to append to multiple tables.
While I know this is an unbound form thing, my knowledge is somewhat fuzzy beyond that. Any help would be appreciated.
~Chad
Edit: I realized something, just now--that the data in ctlNick could be stored with the remaining account data from where duplicates could be disallowed if I bind the form to tblAccounts. That would simplify matters a little, I think--but even if I do, I'm not certain how to tell the system to first execute an updating of the data to tblAccounts and then, if all records meet validation, to append the value of ctlNick to the two remaining tables.
I have a form to add an account to our database as a valid account (frmAccountSetup).
On this form are several controls to add valuable information about the account (startup date, address, etc) to a table that holds that information (say tblAccounts). But when an account gets added to the system we also need to add a paycode and an expense code for that account to their respective tables (tblExpenseCodes and tblPayCodes). Not all paycodes or expensecodes are bound to an account, however, so it's not as simple as I would like it to be.
The paycode and the expensecode are the same short text string (assigned an autonumber when they hit the table) populated from a control (ctlNick) on the form in question, frmAccountSetup.
This much I can set up. Here is where I'm somewhat lost:
What I would like is for a user to be able to fill out the data for the account setup and click an 'update account' control that first checks to see that all the required fields have been filled for the first table tblAccounts, then verifies that the ctlNick (short text string) is NOT a duplicate of existing paycodes or expense codes and then appends the ctlNick value to tblExpenseCodes and tblPayCodes, finishing with a succesful completion msgbox.
I'm not certain how to a) tell the system to first check for rule violation and required fields across multiple tables and cancel and return an error message if it fails and b) how to append to multiple tables.
While I know this is an unbound form thing, my knowledge is somewhat fuzzy beyond that. Any help would be appreciated.
~Chad
Edit: I realized something, just now--that the data in ctlNick could be stored with the remaining account data from where duplicates could be disallowed if I bind the form to tblAccounts. That would simplify matters a little, I think--but even if I do, I'm not certain how to tell the system to first execute an updating of the data to tblAccounts and then, if all records meet validation, to append the value of ctlNick to the two remaining tables.
Last edited: