Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a Detail form, based on Main form field 1

Status
Not open for further replies.

grendal

MIS
Sep 30, 2001
35
GB
I have two forms Main (customer accounts) and Sales (per account). I've created a command button in the Main form to run a macro. The macro is an Openform action. the form name is "Main" and the condition is "[Account]=[Sales].[Cust-acc-num]. When I hit the command button a dialogue box prompts me for "Sales.Cust-acc-num". I've checked the spellings and field types, I've no relationships or primary keys. If I manually enter an existing detail from "Cust-acc-num" I see the results I expect. Any thoughts?
 
Hi braindead2. Thanks for your response, 1 have a further question, how do I get the Sales form to only show detail related to the Main form?
 
it seems like you're forms are kind of backwards? at first you say you are on the MAIN form, and your button says to open the MAIN form where the account is the same as on the SALES form...is this really correct? Seems like you'd want a button on your MAIN form that opens the SALES form where the Account number = the account number on the MAIN form?

docmd.openform "Sales", "[Account]= " & forms![Main]![Cust-acc-num]"

also, a cooler thing to do might be to put the sales stuff as a SUBFORM on the main form, then you can see the sales records right there as you flip thru the accounts, instead of going to a totally different form. just a thought

g
 
Hi GingerR,
I've been on been working in Holland for the last few weeks, so I've not had a chance to complete my Sales Project. I've tried for your suggestion and it works fine - THANKS FOR HELP.

Grendel s-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top