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
Is there a way to restore the default local security policy to a server?
error 2009 , my dos application under foxplus is not run with XP
How do I STOP a network drive from automatically mapping when I logon?
Go to a specific Record in a popup form from a record listed in an open form/subform
how so I get the uniqueidentifier after insert in SQLEXPRESS?
Build SQL statement from a form
Installing SQL Server 2008 64-bit on Windows Server 2008 64-bit
Access VBA to test for login or logout status ( If then Next)
Open Visual Foxpro DBF file without FPT filed
SQL Reporting Services - Service Unavailable