• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 490
  • Last Modified:

microsoft access vba code syntax help

I have a module called mod_Lock that has a public function:

Public Function acbWhoHasLockedRecord(frm As Form)
.....
End Function

I have an unbound text box (called txtSearch) on my form.  I want to call this function in the after update event of the text box:

Private Sub txtSearch_AfterUpdate()

................somehow call the function

End Sub

How do I do this?  The name of my form is "Service Log New"
0
sxxgupta
Asked:
sxxgupta
1 Solution
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:


Private Sub txtSearch_AfterUpdate()

Call acbWhoHasLockedRecord (Me)

End Sub
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
you call the function with "me" as argument, "me" is the keyword to use to refer to the form itself:

 
Private Sub txtSearch_AfterUpdate()

 acbWhoHasLockedRecord me

End Sub 

Open in new window

0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
:-)
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
sxxguptaAuthor Commented:
thanks mx
0
 
hnasrCommented:
'   ................somehow call the function
Dim strWho As String       ' to hold the return value of the function
strWho = acbWhoHasLockedRecord(Me)
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
You are welcome ...
0

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

Tackle projects and never again get stuck behind a technical roadblock.
Join Now