Can i do the conditional format in subform with Query?

veasna

Registered User.
Local time
Yesterday, 18:50
Joined
Dec 21, 2009
Messages
18
+ My problem is:
- I have table "Guide" that has fields "Guide_Name and Guide_Language" and table "Guide_Booking" that has fields "Booking_Date and Guide_Id".
- In the index form i have a subform name "Guide_Booking subform".
+ My question is: i want to put the conditional formatting (red color) to the "Guide_Id" field of table "Guide_Booking" in subform "Guide_Booking subform" if Guide_Language not equal to "English".

Could you please help me to solve this problem?

Thanks,
Veasna
 
Thanks you very much for your answer, but my problem is not happen in the same table.

+ For example I have the following tables:
- Table Language (Language_Id, Language_Name)
- Table Guide (Guide_Id, Guide_Name, Language_Id)
- Table Guide_Booking (Booking_Id, Date, Guide_Id)
- if Guide_Id in Guide_Booking do not speak "English" i want to field the background color in red.

+ Here is the brief:
- Table language:

ID-----Name
1 -----English
2 -----French

-Table Guide:

ID --- Guide_Name ----Language
1 -----Mr.A ----------- English
2 -----Mr.B ----------- French

-Table Guide_Booking:

ID ----Date ------------Guide_Name
1 -----12-Dec-2009 --- Mr.A

If you know how to do this please help me.

Thanks,
Veasna
 
Last edited:
Include the language field from the Guide_Name table in the Record Source query of the form where it will be available to the conditional formatting.

BTW. The Language field in the Guide_Name table should be stored as the ID from the Language table rather than the Name. Likewise the Guide_Name field in the Guide_Booking table should be the ID, not the name.

It is usually better to use unique ID field names such as GuideID, LanguageID etc rather than just ID in all tables. Access will guess at the relationships and automatically join the fields called ID when creating a query and you then have to delete them.

It is a personal preference but I highly recommend you drop the underscore from the tablenames. It is unnecessary. GuideName is just as readable and easier to type. I also believe underscores in control and form names should be especially avoided since VBA uses automatically inserted underscores in procedure names to separate the object name and action.
 

Users who are viewing this thread

Back
Top Bottom