Record Update

pgp

Registered User.
Local time
Today, 19:43
Joined
Jul 1, 2003
Messages
33
Hi,

Im having a subform which displays a couple of records. When I try double clicking on one record, I want to open a new form with record details - bound so that when I make changes to any field, I automatically update the table.

I did write a query and made that the control source of my new form. I also made all fields control source their corresponding table fields.

But, when I double click, its opening the new form but with no values.

I would appreciate any help
Thanks in advance
 
You should use the link criteria of the OpenForm command

use code like:

Dim stDocName As String
Dim stLinkCriteria As String

'form to open
stDocName = "frmNew"

stLinkCriteria = "[Record#]=" & Me![Record#]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Good Luck.
 
Hi,

Thanks for your response.
I did try that out, but still it displays nothing on the new form.

I have a main form with quotenumber & revnumber and subform, in which I have lineitems with lineitem numbers

Once I double click the record, it should open the full details of the record for that lineitem.

Is there anything else Im doing wrong?

Thanks again
 
When you say 'full details', does that include the quotenumber and revnumber displayed on the main form? What is your link criteria and is it a primary key/unique value?
 
Hi,

I have 2 tables quoteheader & quotelineitem.
For every quote that I create , I can have more than one lineitems quoted with that quotenumber

When I go to a createquote main form - I have a quotenumber automatically generated -a revisionnumber always starts with 0 and some details like customer info that I store in quoteheader table.

On this main form, I have a subform which links with this main form using quote number & rev number. It displays all the items that are quoted for this quote number & rev number and lineitem info is stored in quotelineitem table.

I have quotenumber & rev number as my primary fields.
have them both in quoteheader & quotelineitem table.

Now, when I click on any one of the lineitem , say 1, then it should open the record from quotelineitem table for the quotenumber & rev number on the main form and lineitem number on the subform.

Hope I didn't confuse you
Thanks so much for your help
 
Not sure I can be much help but maybe you could post the OnDoubleClick Code (that may be where the problem is).
 
This is my doubleclick event code, My new form is ChangeNomexQuote, and in my subform - I have text18 as my lineitem number field.



Private Sub Form_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "ChangeNomexQuote"

stLinkCriteria = "[LineItem]=" & Me.Text18
DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms.Item("[ChangeNomexQuote]").Requery
End Sub


Thanks in advance
 
Nothing wrong there. It may be something to do with the query that ChangeNomexQuote is based on or some programming in the OnOpen action of this form, otherwise I'm stumped. Sorry:(
 

Users who are viewing this thread

Back
Top Bottom