Please help! Where Condition in a Macro

L

Lainni

I have very little knowledge of VB and I thought Access 2007 would be easier
but I am still running into problems. I have a split form that contains
records of distributors and I would like users to be able to click on the
distributor's id and have a form open up that contains all that distributors
information. I have both forms set up but I am having trouble with the macro
for the on click event. I used the OpenForm action and
Form Name Distributor1
View Form
Where Condition [DistributorID]=Forms!Distributor1!DistributorID

Do I need to set up a temp variable first and a procedure in case of an error?
 
L

Lainni

Wayne, thank you for the help, but I am still having trouble. I plugged the
where clause into my macro but I am still having problems with it. When I
click on the DistributorID, two parameter boxes pop up one after the other
asking for the DistributorID. Do I need to set temporary variable before
this?

Thanks

Wayne-I-M said:
[DistributorID]=[Forms]![MainFormName]![SubFormName].[Form]![DistributorID]


--
Wayne
Manchester, England.



Lainni said:
I have very little knowledge of VB and I thought Access 2007 would be easier
but I am still running into problems. I have a split form that contains
records of distributors and I would like users to be able to click on the
distributor's id and have a form open up that contains all that distributors
information. I have both forms set up but I am having trouble with the macro
for the on click event. I used the OpenForm action and
Form Name Distributor1
View Form
Where Condition [DistributorID]=Forms!Distributor1!DistributorID

Do I need to set up a temp variable first and a procedure in case of an error?
 
W

Wayne-I-M

This means that DistributorID is not a control name on the forms and you
access is asking you to provide it

Note the control name is "not" always the same as the field name it is based
on.

Open the form in design view and then the properties box for the control and
check the "name" not the source


--
Wayne
Manchester, England.



Lainni said:
Wayne, thank you for the help, but I am still having trouble. I plugged the
where clause into my macro but I am still having problems with it. When I
click on the DistributorID, two parameter boxes pop up one after the other
asking for the DistributorID. Do I need to set temporary variable before
this?

Thanks

Wayne-I-M said:
[DistributorID]=[Forms]![MainFormName]![SubFormName].[Form]![DistributorID]


--
Wayne
Manchester, England.



Lainni said:
I have very little knowledge of VB and I thought Access 2007 would be easier
but I am still running into problems. I have a split form that contains
records of distributors and I would like users to be able to click on the
distributor's id and have a form open up that contains all that distributors
information. I have both forms set up but I am having trouble with the macro
for the on click event. I used the OpenForm action and
Form Name Distributor1
View Form
Where Condition [DistributorID]=Forms!Distributor1!DistributorID

Do I need to set up a temp variable first and a procedure in case of an error?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Syntax Where Condition in Macro 3
macro help 2
Normalization question 2
Library references 1
Access 2007 Macro Condition 1
Open Form / Where Condition 3
OpenForm: Where Condition 1
where condition 5

Top