Hi all,
I am really stuck on this problem
Hopefully someone can give me a few pointers.
I am running Access 97, I want to do some conditional formatting on a form. There is no conditional formatting feature (i.e. formatting such as different background colour dependent on value) in Access 97.
I tried to do it by code but since I am using a continuous form, the formatting applied to all textbox. I then try to do it as a normal (i.e. non-continuous form), but I reached the maximum limit number of textbox I can add to a form
So instead, I have the idea of exporting the result of a query (the data I used to create my form) to Excel 2000 first. Then do the conditional formatting under vba in Excel. Since under Excel I can do more formatting feature such as adding border etc..
I managed to do the exporting using:
DoCmd.OutputTo acOutputQuery, "qry_FaultGroup_Details", acFormatXLS, "FaultGroup.xls", True, C:\Test\FaultGroup.xlt"
This will generate the result of the query to a new excel spreadsheet and open excel.
However, I am stuck on attaching my conditional formatting vba code (in excel) to this newly created spreadsheet.. (or even better automatically run the formatting code). I tried saving the code inside a excel template, and calling the template under OutputTo ... but I think the code didn't get save in the template for some reason.
Anyone can give me some bright ideas on how I can get around this?
Thanks in advance,
Hadwin.
I am really stuck on this problem

I am running Access 97, I want to do some conditional formatting on a form. There is no conditional formatting feature (i.e. formatting such as different background colour dependent on value) in Access 97.
I tried to do it by code but since I am using a continuous form, the formatting applied to all textbox. I then try to do it as a normal (i.e. non-continuous form), but I reached the maximum limit number of textbox I can add to a form

So instead, I have the idea of exporting the result of a query (the data I used to create my form) to Excel 2000 first. Then do the conditional formatting under vba in Excel. Since under Excel I can do more formatting feature such as adding border etc..
I managed to do the exporting using:
DoCmd.OutputTo acOutputQuery, "qry_FaultGroup_Details", acFormatXLS, "FaultGroup.xls", True, C:\Test\FaultGroup.xlt"
This will generate the result of the query to a new excel spreadsheet and open excel.
However, I am stuck on attaching my conditional formatting vba code (in excel) to this newly created spreadsheet.. (or even better automatically run the formatting code). I tried saving the code inside a excel template, and calling the template under OutputTo ... but I think the code didn't get save in the template for some reason.
Anyone can give me some bright ideas on how I can get around this?
Thanks in advance,
Hadwin.