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
Adobe Flash Player 10 does not work in I.E. 7.0 or 8.0
offline SharePoint Workspace with Office Web Apps
trouble with displaying recordset results in datasheet view
access error 3011
convert delimited text file into 2 dimension array
Registry cannot load the hive.
Vista: can I run a program from a mapped network drive in compatibility mode?
Exchange 2007 to 2010 upgrade
DataGrid Silverlight 3.0 Calculated Value In a Column
Setting folder and file permissions in C#