By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,495 Members | 1,146 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,495 IT Pros & Developers. It's quick & easy.

DoCmd Open Form Issue

P: 8
I have Seen Loads Of Post On This And I Have Spent The Last Hour Trying Everything I Come Across But Still Can Get What I Thought Was A Simple Thing To Work .. LOL

I Have 2 Forms

Vehicles
Defects

Emmedded In Vehicles Is A Subform In Datasheet Mode Of 4 Summary Fields From The Defects Form

The Records Visible In The Subform Are Automatically Filtered Depending On The Vehicle Record That Is Highlighted In The Vehicles Form.

The Field In Question Is DefectID And All I Want To Do Is Double Click The DefectID On The Datasheet And For It To Open Up That Record For Editting In The Defects Form.

Private Sub Defect_ID_DblClick(Cancel As Integer)
DoCmd.OpenForm "Defects", , , "[DefectID] = " & Me.Defect_ID
End Sub
Was My Last Effort

Can Anyone Help Out And Let Me Know Where Im Going Wrong

Ta

Stella
Aug 30 '06 #1
Share this Question
Share on Google+
9 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
Your last code should work the only thing I could think of is something like this

DoCmd.OpenForm "Defects", , , "[DefectID]=" & Me.Defect_ID, , acWindowNormal

Other than this check what is the name of your subform. Make sure its not defects. That is the property name not the form caption. Also in design view make sure that the On Dbl Click event on the Defect_ID field has [Event Procedure] in the field. Make sure that the field name is Defect_ID.

I have Seen Loads Of Post On This And I Have Spent The Last Hour Trying Everything I Come Across But Still Can Get What I Thought Was A Simple Thing To Work .. LOL

I Have 2 Forms

Vehicles
Defects

Emmedded In Vehicles Is A Subform In Datasheet Mode Of 4 Summary Fields From The Defects Form

The Records Visible In The Subform Are Automatically Filtered Depending On The Vehicle Record That Is Highlighted In The Vehicles Form.

The Field In Question Is DefectID And All I Want To Do Is Double Click The DefectID On The Datasheet And For It To Open Up That Record For Editting In The Defects Form.



Was My Last Effort

Can Anyone Help Out And Let Me Know Where Im Going Wrong

Ta

Stella
Aug 30 '06 #2

P: 8
Thanks

i Will Give that A Go

To Clarify

2 Forms - 1 Called Vehicle 1 Called Defects

1 Subform Called Defects subform (Embedded In Vehicle Form)

Field Called DefectID (Control Source) txtDefectID (Name) On Defects Form

Field Called DefectID (Control Source) txtSubDefectID (Name) On Defects Sub Form

Am I Getting These Confused When Using The Where Condition
Aug 30 '06 #3

P: 8
DoCmd.OpenForm "Defects", , , "[DefectID]=" & Me.Defect_ID, , acWindowNormal
This Gave Me A Compile Error With Defect_ID Highlighted

I Changed This To DefectID And Now I Get A Pop Up Box With The Value Of The Record On It , Asking For A Parameter..??

If I Click OK , It Just Shows The Form Defects With All Records Showing

If I Type in The Value In The Parameter Box I Get Exactly What I Want
Aug 30 '06 #4

MMcCarthy
Expert Mod 10K+
P: 14,534
Try this:

DoCmd.OpenForm "Defects", , , "[DefectID]=" & Me.txtSubDefectID, , acWindowNormal

This Gave Me A Compile Error With Defect_ID Highlighted

I Changed This To DefectID And Now I Get A Pop Up Box With The Value Of The Record On It , Asking For A Parameter..??

If I Click OK , It Just Shows The Form Defects With All Records Showing

If I Type in The Value In The Parameter Box I Get Exactly What I Want
Aug 30 '06 #5

P: 8
I tried That After My Last Post

All I get Is A pop Up Box Asking For A Parameter Value

If i type In The Value I Want It Does What i Want It To Do , Exactly

If I type In A Different Defect ID , It Goes To That record , So SOmething Is Working

Just Above The Text Box Within The Enter Parameter Pop Up Shows The Value Of The Record i Clicked On

Ie , DefectID Test001
Aug 30 '06 #6

MMcCarthy
Expert Mod 10K+
P: 14,534
Last try:

DoCmd.OpenForm "Defects", , , "[txtDefectID]=" & Me.txtSubDefectID, , acWindowNormal

When you type in Me. there is a drop down list find the field txtSubDefectID and see if its there.

I tried That After My Last Post

All I get Is A pop Up Box Asking For A Parameter Value

If i type In The Value I Want It Does What i Want It To Do , Exactly

If I type In A Different Defect ID , It Goes To That record , So SOmething Is Working

Just Above The Text Box Within The Enter Parameter Pop Up Shows The Value Of The Record i Clicked On

Ie , DefectID Test001
Aug 30 '06 #7

P: 8
With This One I Get 2 pop Up Boxes

1 Asking For txtDefectID , Then One Asking For Another Parameter

txtSubDefectID Is In The List When I type Me.

Somethings Not Right Somewhere.. LOL

Thanks For Your Help Tho
Aug 31 '06 #8

P: 8
Heres The Code That Finally Got It Working

DoCmd.OpenForm "Defects", , , "[DefectID]='" & Me.txtSubDefectID & "'", , acWindowNormal
Sep 2 '06 #9

P: 7
Heres The Code That Finally Got It Working

DoCmd.OpenForm "Defects", , , "[DefectID]='" & Me.txtSubDefectID & "'", , acWindowNormal


YEa... you probably have DefectID as a text field so you need the quotes around the value.
Jul 11 '07 #10

Post your reply

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