SyntaxSocialist
Registered User.
- Local time
- Today, 12:00
- Joined
- Apr 18, 2013
- Messages
- 109
I'm trying to emulate a behaviour in Access that I see a lot on web forms: you click out of the active control (into blank space, not another control) and the form fields update appropriately.
So I want my users to be able to click on the white space on a form I've built and have that trigger an update event based on the active control. In my case, it only applies to textboxes.
Here's what I've got. The red code is where I'm stuck. I think the Run method is what I'm looking for, but I'm having a hard time figuring out how to use it properly...
So I want my users to be able to click on the white space on a form I've built and have that trigger an update event based on the active control. In my case, it only applies to textboxes.
Here's what I've got. The red code is where I'm stuck. I think the Run method is what I'm looking for, but I'm having a hard time figuring out how to use it properly...
Code:
Private Sub Detail_Click()
Dim strCall As String
strCall = Me.ActiveControl.Name & "_AfterUpdate"
If Me.ActiveControl.ControlType = acTextBox Then
If Me.ActiveControl.AfterUpdate <> "" _
Or IsNull(Me.ActiveControl.AfterUpdate) = True Then
[B][COLOR="Red"]Access.Application.Run ("Private Sub " & strCall)[/COLOR][/B]
End If
End If
End Sub