473,698 Members | 2,643 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Change Color on Field

1 New Member
I have a form with a sub form and I want the field on the main form to change color if the date is greater than today. The field on the main form changes when I scroll from one record to another.

I tried the following code but I get an error that the field is not recognizable.

Private Sub Form_Current()
If Me!TargetFundin gdate < Date Then
Me!TargetFundin gdate.BackColor = 255
Else
Me!TargetFundin gdate = vbWhite
End If

End Sub

Maybe I have the code in the wrong section. Please help...
Jun 20 '07 #1
2 2481
JKing
1,206 Recognized Expert Top Contributor
Are trying to reference the field on the main form from the Current event of the subform?
Jun 20 '07 #2
BradHodge
166 Recognized Expert New Member
I agree with JKing regarding the Form/Subform issue.

I also saw that you forgot to put .BackColor on your vbWhite line...
[IMG]Me!TargetFundin gdate = vbWhite[/IMG]

Using this code with the revised .BackColor worked fine when I tried it on a form.

Good Luck,
Brad.
Jun 20 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

34
4908
by: Andrew DeFaria | last post by:
I thought this would be fairly straight forward but apparently it's not. Given the following html file: <!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <title>Test</title> </head> <body> <form method="post" action="javascript:">
1
1319
by: Thu | last post by:
I export some database data to an XML file. How do I change the sequence of the elements (fields) appear in the XML document? For example, my XML output from TableA is: <TableA> <Field(0)> <Field(1)> <Field(2)>
4
13583
by: DerekM | last post by:
I have a database project that I created with several forms and reports. I would like to be able to declare a single title and be able to change the title on all the forms and reports by changing a single variable. I think this is possible, however I don't know Visual Basic very well. I created a module named DBcommon with the following statements in it: Option Compare Database Global Const DBname As String = "Title String"
2
4389
by: Galina | last post by:
Hello I have an application in MS Access 2000. I have a form, which includes a subform. The subform is based on a table, but locked for any editing. There is Edit button. When clicked, it starts a separate unbound form with all the fields, which are on the subform. The fields are filled in with data programmatically. User edits. Edited fields are copied into fields on the subform programmatically as well. I need to catch change in one of...
4
2403
by: N. Graves | last post by:
Hello; I have a table that is equipment. This table has a filed called Owner and that Owner filed is Looked up from a table called employee. and the query request the serial number of the employee and his/her name. I have this field bound to the serial number but it displays the name in a data sheet. Works great, My problem is I have a form that I want to be used as display and informational but not data entry or editing. I would...
4
26196
by: N. Graves | last post by:
Hello... thank you for your time. I have a form that has a List box of equipotent records and a sub form that will show the data of the equipment select from the list box. Is it possible to make a change in the name field in the details, then refresh the list box with new name? Please help and thanks!
2
3040
by: Danny | last post by:
Hello I am trying to create a separate listbox and fill it with items based on what is in another field in a database. This field is bound to a field in the underlying database. But the data is changed from another list box that is a pulldown of the 3 items. This way they are forced to select one of the 3 items. So when the field updates based on the item chosen, why doesnt it cause the "on change event" to happen? The field has...
6
9169
by: Lauren Wilson | last post by:
Hi Folks, I am totally confused about the following: 1. Is it possible to change the size of an EXISTING TEXT table field in Access 2k or later using DAO or ADO code? 2. If so, does anyone have some sample code? I have ransacked all my documentation to find the answer to no avail. Please advise ASAP!
5
4238
by: HS1 | last post by:
Hello I have a datagrid to show data for a database table using "seclect * from tablename" The datagrid works OK. However, I want to change the name of the fields in the database to other name in DataGrid. For example, a field name in database is "FName" will be shown in dataGrid as "First Name". Could you please tell me how to do that
13
4175
by: nyt | last post by:
I have a problem of number and text field. I got the database file(mdb) that contains many combo boxes used and its list values are created by "value list" For eg field Field name= 'furniture' , data type='Number' ,Display Control='Combo Box', RowSource Type = 'Value List' and Row Source = ' 0;"chair";1;"Table";2;"Bed" ' Therefore, in data sheet view of table, if we select (1 : Table ) ,
0
8611
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8876
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4624
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2341
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.