This takes a bit of programming to do... You need it in a couple of
different events;
a. The Form_Current event, must handle this, when scrolling through the
records..
b. The _Click event of the transaction type (assuming it is a combo box),
must handle this, when changing from a commission to normal transaction...
Some example code, could look like the below.. This has a combo field called
'd_type' which has the values 'Commission' and 'Standard'... When the record
is changed, or the transaction type is changed, it shows a date field and
hides the amount field (for a Commission type) or hides the date field and
shows the amount field (for the Standard type).
Option Compare Database
Option Explicit
Sub SetVisibleProperties()
If d_type.ListIndex = 0 Then 'Commission
[amount].Visible = False
[date].Visible = True
Else 'Other
[amount].Visible = True
[date].Visible = False
End If
End Sub
Private Sub d_type_Click()
SetVisibleProperties
End Sub
Private Sub Form_Current()
SetVisibleProperties
End Sub
Private Sub Form_Load()
SetVisibleProperties
End Sub
"George Steward" <go*****@clara.net> wrote in message
news:10****************@ersa.uk.clara.net...
I have a form in which I only want certain boxes to show under certain
conditions, for example, when a transaction is selected as "commission" I
need to show the fields for entering the relevant information but to hide
them when any other type of transaction is selected.
How do I change the "visible" property of a particular field
programmatically so that it reverts to normal after the event?