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
Using subquery to supply VALUE in INSERT statement
pause code in sql2008 through Access07
Cannot execute stored procs from Access without using SQL Native Client driver
How do I limit concurrent IE sessions for a Citrix user on Windows 2003 server?
Access Query Design Where/Or Criteria Trouble (SQL Where)
ALTER TABLE / ALTER COLUMN QUESTION???
Linked table question
Migrating app from VB.net 2005 to VB.net 2008 SqlCeEngine compatibility issue needs fixed
Updating date returned from SQL
Getting the duration of an audio file using VB.NET