Microsoft
Software
Hardware
Network
Question : Setfocus in a function
I am trying to find a record in a function. I have multiple forms like this so I thought I'd do it in a function. This does not work..
Function findcase(caseid As String)
ActiveForm.accid.SetFocus
DoCmd.FindRecord caseid
ActiveForm.local_case_id.S
etFocus
End Function
I know it works to use forms![formname]![accid].s
etfocus but how do I pass it?
I tried to add a second parameter but it kept asking for an =.
This should be easy - why am I so frustrated?
Answer : Setfocus in a function
try
Function findcase(caseid As String, sForm as string, sControl as string)
Forms(sForm)(sControl).Set
Focus
DoCmd.FindRecord caseid
End Function
to use
call findcase("1234","NameOfFor
m","NameOf
Control")
Random Solutions
Need help with DAO recordset connection
Remote Desktop to XP PC - connection drops briefly
user.identity is not recognized in master page
Looping through a combo box or a list
ows Timer service slow down the vertual machine in sharepoint
Base results in a subform on a value from a combo box in a main form in Access 2007
Find drive letter of a named drive
SQL query help for an online shop
populate textbox value into table field using code
How to restore a database?