|
-
May 13th, 2011, 11:31 AM
#1
Thread Starter
Junior Member
[RESOLVED] Calling a Function from a form...
I am using this function to populate a combo box...
Public Function AddStates(F As Form, ctl As Control)
'MsgBox F & "." & ctl
Set RS = DB.OpenRecordset("tblUnited_States")
For i = 0 To RS.RecordCount - 1
F.ctl.AddItem RS![Abbreviation]
RS.MoveNext
Next
RS.Close
Set RS = Nothing
End Function
I call it from my form using this call...
AddStates frmAdd_Store, Combo1
When I run this I get Run-Time error 438...
I'm not so sure that the form name or the control names are getting passed, as it will err out on the msgbox statement alone.
Any ideas?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|