Jumat, 11 Mei 2018

[MS_AccessPros] Re: SetFocus => Run-time error '438'

 

Steve - Try changing it to Me.VendorID or even Me.Controls("VendorID")


You might want to preface the control with a name other than the name of the field such as txtVendorID. When controls have the same name as the field they are bound to you can sometimes get a confusion as ti whether the compiler sees it as the control or the field.

Regards,
Bill Mosca, Founder - MS_Access_Professionals
http://www.thatlldoit.com
My nothing-to-do-with-Access blog
http://wrmosca.wordpress.com


---In MS_Access_Professionals@yahoogroups.com, <thaw5@suddenlink.net> wrote :

The user has a Cancel command button which closes frmVendorEdit and then
opens frmVendor (a continuous form). When frmVendor opens, I want it to
find the record based on the VendorID which was provided by
frmVendorEdit's openargs argument when that form closed. VendorID is an
autonumber field in the underlying table.

This snippet of code in the frmVendor Load event fails on
Me!VendorID.SetFocus with this error: Run-time error '438': Object
doesn't support this property or method.

   If Nz(Me.OpenArgs) <> 0 Then
      Dim varOpenArgs As Variant
      varOpenArgs = Me.OpenArgs
      Me!VendorID.SetFocus
      DoCmd.FindRecord varOpenArgs
   End If

What am I doing wrong?

Thanks, Steve
 

__._,_.___

Posted by: wrmosca@comcast.net
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (5)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar