Someone help

crich21

Registered User.
Local time
Today, 10:42
Joined
Jan 10, 2003
Messages
97
I have a frmVendors with a subform frmpartssubform, the subform is displayed in datasheet view. I am trying to use conditional formatting but when I use the expression is feature, the database opens and states it has encountered and error an must close.

The wierd thing is that after I initially add the conditional format, the form works perfectly, until the db is closed then reopened.

It maybe the syntax I am using. Is this correct, or does anyone have any suggestions.

Forms!frmvendors!frmpartssubform.Form!currentlyused=False
 
If the control you are checking is in the same form as the field you are formatting, just use -
[currentlyused] = False
 
no its not

Pat Hartman said:
If the control you are checking is in the same form as the field you are formatting, just use -
[currentlyused] = False

I have two txtboxes that I want to apply the conditional formatting to base on a checkboxes value. The problem is when I enter an expression as a condition the error occurs and I can't get rid of the error unless I remove the expression. Both textboxes are in a subform and so is the checkbox. So I believe the expression should be
Forms!frmvendors!frmpartssubform.Form!currentlyused=False

Which seems to work fine until I compact and close the db and try to reopen the main form, then it says it has encountered an error and must close the db. this error occurs everytime I open the main form.
 
DO NOT refer to columns of the curent form's recordsource with that notation, use Me.FieldName in VBA or in the conditional formatting dialog, use [FieldName]. You only use the full "Forms!...." reference style when referring to a control on a form from somewhere else such as a module or different form.
 
I don't know what I am doing wrong

Pat Hartman said:
DO NOT refer to columns of the curent form's recordsource with that notation, use Me.FieldName in VBA or in the conditional formatting dialog, use [FieldName]. You only use the full "Forms!...." reference style when referring to a control on a form from somewhere else such as a module or different form.

I have tried - me.frmpartssubform.currentlyused = false - this returns no response

I have tried - [frmpartssubform].[currentlyused] = false - this doesn't return any response either

If I use [currentlyused]=false then it works but, when I close the db and reopen it I am still getting an access error saying that the db has encountered an error and access must close!!! I don't know how to start tracing this problem. I thought it had to do with my expression but since I am referencing it differently it still does it.

I guess I am wondering if I can apply conditional formatting to a field in a subform based on the condition of another field in that same subform????
 
Last edited:
The db appears to be corrupted. Try the decompile switch (search the forum for instructions). Then open a new db and import all the objects into it. If you can rebuild the form with the problem, that would be best or you can try to import it.
 
Pat Hartman said:
The db appears to be corrupted. Try the decompile switch (search the forum for instructions). Then open a new db and import all the objects into it. If you can rebuild the form with the problem, that would be best or you can try to import it.

Thanks for the response. I will try all you suggested.
 

Users who are viewing this thread

Back
Top Bottom