Message microsoft access error

nate0057

Registered User.
Local time
Today, 12:00
Joined
Oct 4, 2012
Messages
74
I tried to code the different flags like that:

Code:
[SIZE=3][FONT=Calibri]If ([flagblup] = 1 And [redticket] = "Blueprints") Or ([flagconp] = 1 And [redticket] = "Control Plan")  Then
   Me.redticket.BackColor = RGB(237, 28, 36)
Else
   Me.redticket.BackColor = RGB(255, 255, 255)[/FONT][/SIZE]

I have this error:


“Microsoft Access can’t find the field ‘|1’ referred to in your expression”

So I tried to define flag like that :

Code:
Dim varflagblup As Variant, varflagconp As Variant

But it doesn’t work.

Do you have an idea to fix it??

Thanks.
 
This error occurs only when the field you are trying to access are not included in the Record Source of the Form.. Go to the Design view of the Form and Click the Data tab, under which you will find the RecordSource click the eclipse (...) button it will invoke the query builder.. Make sure that.. all these field are included in the record source.. [flagblup], [redticket], [flagconp], [redticket].. If not sure.. just use
Code:
SELECT * FROM yourTableName
 

Users who are viewing this thread

Back
Top Bottom