Secretgeek
Technical User
Good afternoon,
This may be better off in the VBA Code Forum. If so I apologise.
I have a control - 'Legislation' -that when a certain value is selected - 'DPA' - two dates are calculated, another control 'FOIType'(a combobox) has it's value set to "n/a" and the focus moves to another control.
The problem is that when 'DPA' is selected the two dates show immediately in their boxes but 'FOIType' remains blank. Moving to the next record and back again shows that the value is being set correctly it's just not being shown.
I've tried Refresh, Requery and Repaint and I'm either getting type mismatch errors or nothing at all and I'm starting to have a brain melt down. Any help would be much appreciated. Here is my code as it stands at the moment:
[blue] Private Sub Legislation_Change()
If Me!Legislation Like "FOI*" Or Me!Legislation Like "EIR" Then
Call basMgtDate(20, [NCC Date Received])
Me![DPA Type] = "n/a"
Me![DPA Stage] = "n/a"
Else
If Me!Legislation Like "DPA" Then
Me![FOI Type] = "n/a"
Me![IGO Deadline] = DateAdd("d", 40, [NCC Date Received])
Me![Dept Deadline] = DateAdd("d", 20, [NCC Date Received])
Me![DPA Type].SetFocus
End If
End If
End Sub [/blue]
Thanks in advance for your help.
This may be better off in the VBA Code Forum. If so I apologise.
I have a control - 'Legislation' -that when a certain value is selected - 'DPA' - two dates are calculated, another control 'FOIType'(a combobox) has it's value set to "n/a" and the focus moves to another control.
The problem is that when 'DPA' is selected the two dates show immediately in their boxes but 'FOIType' remains blank. Moving to the next record and back again shows that the value is being set correctly it's just not being shown.
I've tried Refresh, Requery and Repaint and I'm either getting type mismatch errors or nothing at all and I'm starting to have a brain melt down. Any help would be much appreciated. Here is my code as it stands at the moment:
[blue] Private Sub Legislation_Change()
If Me!Legislation Like "FOI*" Or Me!Legislation Like "EIR" Then
Call basMgtDate(20, [NCC Date Received])
Me![DPA Type] = "n/a"
Me![DPA Stage] = "n/a"
Else
If Me!Legislation Like "DPA" Then
Me![FOI Type] = "n/a"
Me![IGO Deadline] = DateAdd("d", 40, [NCC Date Received])
Me![Dept Deadline] = DateAdd("d", 20, [NCC Date Received])
Me![DPA Type].SetFocus
End If
End If
End Sub [/blue]
Thanks in advance for your help.