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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Where Condition Macro not linking

Status
Not open for further replies.

EastCoast

Instructor
Apr 13, 2006
31
US
I have a Macro that is attached to a button on a form. When clicked, the button should open up another form that is linked by the ID field. Here is the code I typed into the "Where Condition" section of the macro:

[ID]=[Forms]![Products]![ID]

When I click on the button, it goes to the form, but it does not populate the "ID" field on that form so that it is the same as the ID field from the previous form (the one that has the button.
 
The way you did it, it will only populate if you have a value in [id] that equals Forms![Products]![ID]

.... I think you are looking for a JOIN routine
 
Yes, the Macro works if I already have a value in the ID field, but how would I get it to automatically take the ID that is in the first form and populate that in the ID field on the second form (kind of like a subdatasheet knows what record it is bound to).
 
LEts say that the other form is a subform, you can use in the form_load

Me.[Name Of Txtbox in subform] = Me.Parent.[Name Of wanted label]

Or if it isnt

Forms![Name of form]![name of control] = Forms![Name of main form]![name of control]
 
I appreciate the help. I'm just a bit confused. Since it is not a subform, I would be using the last line of your code. Does that go in the "On Load" property of the Second form? Does it need to be typed into a macro and given a name? If so, what action would I choose in the macro? I can feel it almost being fixed.
 
I did that - when I go to open the 2nd form now, it gives me an error message: Access can't find the Macro 'Forms!...and the rest of the phrase for the code
 
I have a Macro that is attached to a button on a form. When clicked, the button should open up another form that is linked by the ID field. Here is the code I typed into the "Where Condition" section of the macro:

[ID]=[Forms]![Products]![ID]

That should work. Products is the form that has the button, right? (Not the name of the form you are opening)

 
Here is the code that is in the "On Load" property of the second form (EvaluationType):

[Forms]![EvaluationType]![ClassID]=[Forms]![Classes]![ClassID]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top