Hi Duane,
VendorID was not enabled. Correcting that resolved the problem. No more run-time error.
Although I didn't include it in my posting, I do have a Debug.Print immediately after the If statement to verify that the correct VendorID is being provided to the frmVendor load event.
Thanks so much! :-)
Steve
Steve,
I would add at least one debug.print or msgbox in this code.
Is VendorID the name of a control that is visible and enabled?
This is the link to explain the arguments: https://msdn.microsoft.com/en-us/vba/access-vba/articles/docmd-findrecord-method-access?f=255&MSPPError=-2147217396
Regards,
Duane
From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of Steve thaw5 thaw5@suddenlink.net [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Friday, May 11, 2018 9:34 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] SetFocus => Run-time error '438'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: Steve thaw5 <thaw5@suddenlink.net>
------------------------------------
------------------------------------
Yahoo Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/MS_Access_Professionals/
groups.yahoo.com/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/MS_Access_Professionals/join
(Yahoo! ID required)
<*> To change settings via email:
MS_Access_Professionals-digest@yahoogroups.com
MS_Access_Professionals-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
MS_Access_Professionals-unsubscribe@yahoogroups.com
<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/
Posted by: Steve thaw5 <thaw5@suddenlink.net>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (3) |
Tidak ada komentar:
Posting Komentar