I have a checkbook database that is basically a check register.
I have a form "fCNewCheck" which is used to enter new checks. I have a "CheckNumber" field in this form with the default value set to
=DMax("[CheckNumber]","tCTransactions")+1. This automatically fills in the next check number. This works fine as long as you only have one checking account in the database. If you have 2 or more checking account is selects the highest checknumber plus 1.
My question what do I put in the default field of "CheckNumber" to make it look at the combo box on the previous form that selects which account to use. I already have one field in the "fCNewCheck" form which is based on the accountname combobox of the first form used to select the account.
Here is an example of how I am using the previous form to select the account name.
I have a hidden field in the "fCNewCheck" for the "AccountName" with its default value set to =[Forms]![fCSelectAccountName]![Combo4] which automatically adds the check to the proper account based on which account the user selected on the previous form.
I'm wanting something similar in the CheckNumber field to add 1 to the check number of the selected account.
Hope this makes sense and I think that I'm am close to the answer. I have just been thinking about it way to hard.
By the way, this is my first serious attempt at a database and I am just about done. Just finding my little screw ups. Thanks for all of the help you all have given me in the past. I am a search this forum junkie.
I get the same result with the code you gave me as I do with what I originally started out with. My checking account names are "test" and "Main Checking". Main Checking is on check number 648 and test is on 002.