I'm sorry this is rather wordy!!
I have a DB with forms that are operating in the following sequence:
Menu form:
Button to add organization - this links to form (Org_and_Accts) that displays input fields for the org (name, addr, etc), code is:
DoCmd.OpenForm "frm_Organizations_and_Accounts", acNormal, "", "", acAdd, acNormal
Works great.
Button to display existing organizations - this opens a dropdown box to select the org, once clicked it opens the same form above (Orgs_and_Accts).
DoCmd.OpenForm "frm_Organizations_and_Accounts", acNormal, "", _
"[tbl_Orgs]![OrgName]=[Forms]![frm_New_Menu]![comb
rgs_and_Accounts]", , acNormal
Works great.
Org_and_Accts form:
button to go back to menu
button to add accts
If the form as opened for an existing organization, it shows the org info and the subform for it’s accts – which has the fields about the org, plus has a subform that lists all the accounts for that org. If I click on any of the fields in the subform, it opens the Acct_Detail form for that acct and the org info (name, addr, etc).
Works great.
If the form was opened as a new organization, the subform does not display but they can click the add accts button which will take them to an Acct_Detail form. This is where my problem is.
The Acct_Detail form displays fields to add the acct info but I also want to display the org's info. The form was built with the form wizard with both the Org Table and the Acct Detail Table. When I open the form from the Org_and_Accts form when adding accts, I am using the following code:
DoCmd.OpenForm "frm_Accounts_Detail", acAdd, "", "((tbl_Orgs.OrgName) = Me.txt_OrgName)", acAdd, acNormal.
The Me.txt_OrgName is the field from the Org Table on the Org_and_Accts form and I was hoping to open the Acct_Detail form with the blank fields that are used to add the detail and also display the Org Table information in other fields on the form. But now that I've coded the "where" statement information the form opens totally blank except for the heading.
If this makes any sense at all to anyone, I’d appreciate it! And thanks for taking the time to at least read all of this!
I have a DB with forms that are operating in the following sequence:
Menu form:
Button to add organization - this links to form (Org_and_Accts) that displays input fields for the org (name, addr, etc), code is:
DoCmd.OpenForm "frm_Organizations_and_Accounts", acNormal, "", "", acAdd, acNormal
Works great.
Button to display existing organizations - this opens a dropdown box to select the org, once clicked it opens the same form above (Orgs_and_Accts).
DoCmd.OpenForm "frm_Organizations_and_Accounts", acNormal, "", _
"[tbl_Orgs]![OrgName]=[Forms]![frm_New_Menu]![comb
Works great.
Org_and_Accts form:
button to go back to menu
button to add accts
If the form as opened for an existing organization, it shows the org info and the subform for it’s accts – which has the fields about the org, plus has a subform that lists all the accounts for that org. If I click on any of the fields in the subform, it opens the Acct_Detail form for that acct and the org info (name, addr, etc).
Works great.
If the form was opened as a new organization, the subform does not display but they can click the add accts button which will take them to an Acct_Detail form. This is where my problem is.
The Acct_Detail form displays fields to add the acct info but I also want to display the org's info. The form was built with the form wizard with both the Org Table and the Acct Detail Table. When I open the form from the Org_and_Accts form when adding accts, I am using the following code:
DoCmd.OpenForm "frm_Accounts_Detail", acAdd, "", "((tbl_Orgs.OrgName) = Me.txt_OrgName)", acAdd, acNormal.
The Me.txt_OrgName is the field from the Org Table on the Org_and_Accts form and I was hoping to open the Acct_Detail form with the blank fields that are used to add the detail and also display the Org Table information in other fields on the form. But now that I've coded the "where" statement information the form opens totally blank except for the heading.
If this makes any sense at all to anyone, I’d appreciate it! And thanks for taking the time to at least read all of this!