By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,500 Members | 830 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,500 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.