A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Ghosting Fields in a form



 
 
Thread Tools Display Modes
  #1  
Old January 29th, 2007, 04:28 PM posted to microsoft.public.access.forms
Surrealdogma
external usenet poster
 
Posts: 13
Default Ghosting Fields in a form

I have a form / subform that I would like to either "ghost out" or somehow
render unusable for a record if a field in that record has a date in it, and
render the fields usable again if that field doesn't have a date. All I have
come up with so far is a macro using "set Value" and setting the Enabled
value to no, but that blanks my fields out for all the records, not just the
one.
Thanks in advance for your assistance.



  #2  
Old January 29th, 2007, 05:00 PM posted to microsoft.public.access.forms
Arvin Meyer [MVP]
external usenet poster
 
Posts: 4,231
Default Ghosting Fields in a form

I'm going to guess that this is happening in a continuous form or in a
form's datasheet view. That is normal behavior. What you can do is to use
the form's Current event to simply lock the control. In a continuous form,
it will lock them all, but that's OK if you are using the form's Current
event because it fires as every record gets focus. Something like this
(aircode):

Sub Form_Current()
If Len(Me.txtDateField & vbNullString) 0 Then
Me.txtDateField.Locked = True
Else
Me.txtDateField.Locked = False
End If
End Sub
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Surrealdogma" wrote in message
...
I have a form / subform that I would like to either "ghost out" or somehow
render unusable for a record if a field in that record has a date in it,
and
render the fields usable again if that field doesn't have a date. All I
have
come up with so far is a macro using "set Value" and setting the Enabled
value to no, but that blanks my fields out for all the records, not just
the
one.
Thanks in advance for your assistance.





  #3  
Old January 30th, 2007, 02:51 PM posted to microsoft.public.access.forms
Surrealdogma
external usenet poster
 
Posts: 13
Default Ghosting Fields in a form

This is great! Thank you!

"Arvin Meyer [MVP]" wrote:

I'm going to guess that this is happening in a continuous form or in a
form's datasheet view. That is normal behavior. What you can do is to use
the form's Current event to simply lock the control. In a continuous form,
it will lock them all, but that's OK if you are using the form's Current
event because it fires as every record gets focus. Something like this
(aircode):

Sub Form_Current()
If Len(Me.txtDateField & vbNullString) 0 Then
Me.txtDateField.Locked = True
Else
Me.txtDateField.Locked = False
End If
End Sub
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Surrealdogma" wrote in message
...
I have a form / subform that I would like to either "ghost out" or somehow
render unusable for a record if a field in that record has a date in it,
and
render the fields usable again if that field doesn't have a date. All I
have
come up with so far is a macro using "set Value" and setting the Enabled
value to no, but that blanks my fields out for all the records, not just
the
one.
Thanks in advance for your assistance.






 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:48 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.