467,908 Members | 1,844 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,908 developers. It's quick & easy.

Opening Form and Moving to Selected Record

Hi friends,

I want a script that will move a form to a chosen record.

Here's what I'm trying:

I get the parameter from la different form using Docmd,openform using openargs

I've been trying docmd.gotocontrol followed by docmd.findrecord, but I keep getting complier errors. Here's my code:

Expand|Select|Wrap|Line Numbers
  1.    If Len(Nz(Me.OpenArgs, "")) > 0 Then
  2.     DoCmd.GoToControl "MemNo"
  3.     DoCmd.FindRecord OpenArgs, , , , , acCurrent
  4. End If
  5.  
It crashes on the first DoCmd command.

Please help.


Dante

(note that 'DoCmd.OpenForm stDocName, , , stLinkCriteria will not work for this application. That limits the records in the form to those meeting the criteria; I need my user to be able to access other records. )
Dec 16 '08 #1
  • viewed: 1485
Share:
4 Replies
missinglinq
Expert 2GB
Where is your current code placed?

Linq ;0)>
Dec 16 '08 #2
Hi Linq,

This code is in the OnLoad of the destination form.

Here's the whole thing:

Private Sub Form_Load()
If Len(Nz(Me.OpenArgs, "")) > 0 Then
DoCmd.GoToControl "MemNo"
DoCmd.FindRecord OpenArgs, , , , , acCurrent
End If
End Sub


Thanks Linq.
Dec 17 '08 #3
Call off the dogs!

Now it works, and I know why.

Thanks anyway Linq and all others who''ve tried


Dante
Dec 17 '08 #4
missinglinq
Expert 2GB
Glad you got it working! Forum etiquette, here and elsewhere, dictates when the original poster solves the problem "off-line" that they post the solution. That way, others with similar problems, who come searching and find the thread, can also be helped.

Linq ;0)>
Dec 17 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by William Wisnieski | last post: by
2 posts views Thread by Lyn | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.