473,322 Members | 1,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Am trying to grey out a field in a form depending on if there's adate in it or not...

Am trying to grey out a field in a form depending on if there's a date
in it or not, using access 2000, and i've tried vbscript and macros...

I've read and tried and reread for a week... I'll be very happy to post
code..

macro try....

IIf(0<DateDiff("d",Date$(),[Forms]![T12TRKV2_1HS]![F1H01R]),
[Forms]![T12TRKV2_1HS]![F1H01R].[Enabled]=False,
[Forms]![T12TRKV2_1HS]![F1H01R].[Enabled]=True)

VBScript try....
Private Sub F1H07E_Enter(T12TRKV2.F1H07E)
If T12TRKV2.F1H07E <> Null Then
T12TRKV2.F1H07E.Enabled = True
T12TRKV2.F1H07E.Locked = False
Else
T12TRKV2.F1H07E.Enabled = False
T12TRKV2.F1H07E.Locked = True
End If
End Sub
my head is bloody from beating it on cement...

what would work in this case, guys? The goal is to let people add data,
but not update it. the backend is ibm DB2 via odbc..

Thanks very, very much...
Nov 12 '05 #1
2 5669
Put the following code in the OnCurrent event of your form:

Me!F1H01R.Enabled = Not IsNull(Me!F1H01R)
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Brainwave Surfer" <ag***@ruby.vcu.edu> wrote in message
news:bu**********@mira.vcu.edu...
Am trying to grey out a field in a form depending on if there's a date
in it or not, using access 2000, and i've tried vbscript and macros...

I've read and tried and reread for a week... I'll be very happy to post
code..

macro try....

IIf(0<DateDiff("d",Date$(),[Forms]![T12TRKV2_1HS]![F1H01R]),
[Forms]![T12TRKV2_1HS]![F1H01R].[Enabled]=False,
[Forms]![T12TRKV2_1HS]![F1H01R].[Enabled]=True)

VBScript try....
Private Sub F1H07E_Enter(T12TRKV2.F1H07E)
If T12TRKV2.F1H07E <> Null Then
T12TRKV2.F1H07E.Enabled = True
T12TRKV2.F1H07E.Locked = False
Else
T12TRKV2.F1H07E.Enabled = False
T12TRKV2.F1H07E.Locked = True
End If
End Sub
my head is bloody from beating it on cement...

what would work in this case, guys? The goal is to let people add data,
but not update it. the backend is ibm DB2 via odbc..

Thanks very, very much...

Nov 12 '05 #2
Perfect!!!! (did take me a while to FIND the oncurrent event, but once
I did, all became crystal clear...

thank you thank you thank you, and warm fuzzies...

jim

PC Datasheet wrote:
Put the following code in the OnCurrent event of your form:

Me!F1H01R.Enabled = Not IsNull(Me!F1H01R)
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Brainwave Surfer" <ag***@ruby.vcu.edu> wrote in message
news:bu**********@mira.vcu.edu...
Am trying to grey out a field in a form depending on if there's a date
in it or not, using access 2000, and i've tried vbscript and macros...

I've read and tried and reread for a week... I'll be very happy to post
code..

macro try....

IIf(0<DateDiff("d",Date$(),[Forms]![T12TRKV2_1HS]![F1H01R]),
[Forms]![T12TRKV2_1HS]![F1H01R].[Enabled]=False,
[Forms]![T12TRKV2_1HS]![F1H01R].[Enabled]=True)

VBScript try....
Private Sub F1H07E_Enter(T12TRKV2.F1H07E)
If T12TRKV2.F1H07E <> Null Then
T12TRKV2.F1H07E.Enabled = True
T12TRKV2.F1H07E.Locked = False
Else
T12TRKV2.F1H07E.Enabled = False
T12TRKV2.F1H07E.Locked = True
End If
End Sub
my head is bloody from beating it on cement...

what would work in this case, guys? The goal is to let people add data,
but not update it. the backend is ibm DB2 via odbc..

Thanks very, very much...


Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mark Gifford | last post by:
Hi, I've inherited an Access database and need to create a form which will allow me to view and alter the data. I've created a new form and using a tip I got from this helpful site...
0
by: MLH | last post by:
I have an A97 query (qryVehiclesNowners2) that has a table field in it named . Depending on the selections made in a number of criteria choices on a form, a field on the form will have string...
14
by: Paul | last post by:
I want to set the page title and/or a form hidden field programatically through ASP.Net. I do not want to use something like... <% sTitle ="My Title" %> <html><title><%=sTitle%></title>..... ...
1
by: John Davis | last post by:
I am writing a program that allows user to select the date in a calendar, and it will update the text fields automatically. I created 2 forms. The first form has 2 text fields (start date and...
3
by: ReidarT | last post by:
I use a label to write some help-text in a web-form. I don't want the user to be able to click in this field so I have disabled it, enable = false. The text color turns grey. I use a cssclass with...
5
by: Peter Verijke | last post by:
Hi, I have a possible framework bug. Sometimes when i call other code by double clikking the datagrid, i get on returning a grey colored cell over the active cell, still showing the old data....
3
by: BrendanMcPherson | last post by:
How can I get a listbox to change a textbox on some selections. I have a listbox which only needs to be filled in on some selections. Is there a way I can have on some selections the textbox go...
2
by: David - Australia | last post by:
G'day from Australia, I'm hoping some bright spark may be able to help me with this one. I'm sure that it can be done, I've just hit a wall with it. So I'm opening it up. I'm storing student...
1
by: Yew12 | last post by:
Ok I have a date field called ADATE and I want to add the column "Duration(Min)" to this date. I have had ago at the code but it still doesn't work. I have tried dividing the added...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.