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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|