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

Formatting Each Record in a Subform Separately

Status
Not open for further replies.

Rohdem

Programmer
Sep 20, 2000
553
US
I want to run some code on each record of a continuous subform. What I am looking for is something similar to the 'on format' in the detail section of a report. I want to adjust some buttons' text colors based on some code that I run. The code uses a field that is on each record in the subform. The buttons are also located on the subform. So when you view the subform, there are two buttons for each record. I tried using the 'on current', but it changed every record on the form to the same thing, based on which record you clicked in. Maybe I'm trying to do something that isn't possible!!! However, I've found that many things that I thought were impossible can be solved by people in this forum.

Mike Rohde
rohdem@marshallengines.com
 
Something that is pssible is creating a function
in a module

this is called like so
=FunctionName([Somefield]) 'Note this can be used in a report or a form or a query.

Now depending on what you pass to the function it could return whatever.

You use VBA to do any number of things in the function.
But it can get slow if it does a lot or if you have lots of records.

Think of it like a balck box you pust something in and it works on it a returns something back.
Note you can pass as many paramters in as you like. But it can only return one value back.


DougP, MCP
dposton@universal1.com

Ask me how Bar-codes can help you be more productive.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top