Oper Arges

J

johnb

Hi All
I have a Access 2003 Form with a subform, which in turn has a subform. the
Sub-Subform is a datasheet view. I need to view some aditional info. I do
this by double-clicking on a field. And the modal popup form pops up. Good! I
open the Popup form using a Double-Click to run Docmd.Openform
"FormName",,,,, Forms!frm_case!subform1!ssubform1!.form.ChildsDetailsID.

In the popup form I have Private Sub Form_Open event with
Me.Recordset.FindFirst "ChildDetailsID = " Me.OpenArgs

But it find All the records. Any suggesstions?

TIA
johnb
 
D

Daryl S

Johnb -

You need the ampersand to tell Access that the Me.OpenArgs is part of the
Findfirst criteria.

Me.Recordset.FindFirst "[ChildDetailsID] = " & Me.OpenArgs

If ChildDetailsID is a string (rather than numeric), then you also need the
text delimeters:

Me.Recordset.FindFirst "[ChildDetailsID] = '" & Me.OpenArgs & "'"
 
J

John W. Vinson

Hi All
I have a Access 2003 Form with a subform, which in turn has a subform. the
Sub-Subform is a datasheet view. I need to view some aditional info. I do
this by double-clicking on a field. And the modal popup form pops up. Good! I
open the Popup form using a Double-Click to run Docmd.Openform
"FormName",,,,, Forms!frm_case!subform1!ssubform1!.form.ChildsDetailsID.

You have too many delimiters: try

Forms!frm_case!subform1!ssubform1.form.ChildsDetailsID

without the ! before .form.

If the dblclick code is in fact on ssubform1, you can do it more simply:

DoCmd.OpenForm "FormName", OpenArgs:=Me!ChildsDetailID

using the "named argument" syntax instead of laboriously counting commas, and
the Me! shortcut to refer to the current form.
 
R

Roger Carlson

You have multiple errors in your code. Here's a link to a couple of samples
that should help:
http://msdn.microsoft.com/en-us/library/aa160845(office.10).aspx


--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L


Daryl S said:
Johnb -

You need the ampersand to tell Access that the Me.OpenArgs is part of the
Findfirst criteria.

Me.Recordset.FindFirst "[ChildDetailsID] = " & Me.OpenArgs

If ChildDetailsID is a string (rather than numeric), then you also need
the
text delimeters:

Me.Recordset.FindFirst "[ChildDetailsID] = '" & Me.OpenArgs & "'"

--
Daryl S


johnb said:
Hi All
I have a Access 2003 Form with a subform, which in turn has a subform.
the
Sub-Subform is a datasheet view. I need to view some aditional info. I
do
this by double-clicking on a field. And the modal popup form pops up.
Good! I
open the Popup form using a Double-Click to run Docmd.Openform
"FormName",,,,, Forms!frm_case!subform1!ssubform1!.form.ChildsDetailsID.

In the popup form I have Private Sub Form_Open event with
Me.Recordset.FindFirst "ChildDetailsID = " Me.OpenArgs

But it find All the records. Any suggesstions?

TIA
johnb
 
R

Roger Carlson

Sorry, I responded to the wrong post. I meant to respond the the original.


--
--Roger Carlson
MS Access MVP
www.rogersaccesslibrary.com
http://rogersaccessblog.blogspot.com/


Daryl S said:
Johnb -

You need the ampersand to tell Access that the Me.OpenArgs is part of the
Findfirst criteria.

Me.Recordset.FindFirst "[ChildDetailsID] = " & Me.OpenArgs

If ChildDetailsID is a string (rather than numeric), then you also need
the
text delimeters:

Me.Recordset.FindFirst "[ChildDetailsID] = '" & Me.OpenArgs & "'"

--
Daryl S


johnb said:
Hi All
I have a Access 2003 Form with a subform, which in turn has a subform.
the
Sub-Subform is a datasheet view. I need to view some aditional info. I
do
this by double-clicking on a field. And the modal popup form pops up.
Good! I
open the Popup form using a Double-Click to run Docmd.Openform
"FormName",,,,, Forms!frm_case!subform1!ssubform1!.form.ChildsDetailsID.

In the popup form I have Private Sub Form_Open event with
Me.Recordset.FindFirst "ChildDetailsID = " Me.OpenArgs

But it find All the records. Any suggesstions?

TIA
johnb
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top