CmdButton Linking?

witney

New member
Local time
Today, 00:42
Joined
Aug 14, 2001
Messages
6
I am trying to put a button on a form that when pressed, opens another form related to the ID number of the previous form. (Eg; An Orders form with a button that opens a Customer form to select the customer related to that order.) Therefore, I require the customer form to open up with the order ID which was on display in the order form when I clicked the button.
I have added the button to the form by using the wizard, and when it asks what records to show, I have asked for the two ID fields to be linked (which are also linked by a relationship). However, firstly the button doesn't work as it produces an error saying there is an Ambiguous Name Detected. I can then create a macro to open the form and attach that to the button, and the button will then open the form. But it doesn't link with the order ID. If I am currently in order ID 1, the customer form opens with a order ID 0.
I have tried looking at books and example databases that come with Access and can't see any obvious reasons why I am having problems.
The database I am creating isn't complex in any way at the moment, as this is one of the first databases I have created. I do not know much about Visual Basic code but I feel this is wear the problem may lie.
Hope someone can help.
Thanks in anticipation.

Mark
 
Hi
Try Creating a OpenForm macro and specify the parameters in Where condition like

[MyTable]![MyField]=Forms![MyForm]![CustID]

Hope that'll solve ur problem

Cheers!
Aqif
 
After reading the above suggestion, I have tried putting in [Orders]![MatchID]=Forms![Customer]![MatchID]. However, when I now click the button it asks me for a Parameter Value. Should I be getting this, and if so, what do I need to put in there for it to work?
 

Users who are viewing this thread

Back
Top Bottom