Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding another option OnActivate

Status
Not open for further replies.

angelandgreg

Technical User
Sep 20, 2006
106
0
0
US
I have this ...

Private Sub Form_Activate()
On Error GoTo Err_Form_Activate
Me.Requery
If IsLoaded("Customers") Then
If Forms![Customers]![QuoteSummary Subform].Form.RecordsetClone.RecordCount > 0 Then
DoCmd.GoToControl "QuoteID"
DoCmd.FindRecord Forms![Customers]![QuoteSummary Subform].Form![QuoteID]
End If
End If

Exit_Form_Activate:
Exit Sub

Err_Form_Activate:
MsgBox Err.Description
Resume Exit_Form_Activate
End Sub


I would like to edit this line:
DoCmd.FindRecord Forms![Customers]![QuoteSummary Subform].Form![QuoteID]


so that from another form it'll open the quote form when the QuoteID is doubled-clicked. how do I add this or something like this to the above:
Forms![Customers]![ByQuoteform]

Basically this ByQuote form will be a list of all the quotes and the user can locate the quote number (QuoteID) and double-click to view the quote.
 
Hi,
i still get the Enter Parameter Value prompt

Forms!Customers!QuoteSummary subform.Form!QuoteID

click OK and it comes up again then the CustomQuote from opens without the quote information.


The only thing I have in the ByQuote form is on the QuoteID and on Double-click

Code:
Private Sub ViewOrder()
On Error GoTo Err_ViewOrder
    DoCmd.OpenForm "CustomQuotes"
    
Exit_ViewOrder:
    Exit Sub

Err_ViewOrder:
    MsgBox Err.Description
    Resume Exit_ViewOrder
End Sub

Private Sub QuoteID_DblClick(Cancel As Integer)
    ViewOrder
End Sub
 
Like I said, the way you want to do this is not recommended. You should use the Where or OpenArgs arguments of OpenForm.

It seems that the Customers form is loaded. Please describe your exact set-up. it is tedious guessing. You had better post the code you are using for IsLoaded, too.
 
Hi Remou,
I don't know how to do that.

I don't know how else to explain this.

I don't have any other forms open except the ByQuote form.

This form lists all the existing quotes. I am trying to have this for the users so they can view the quote from a list of quotes instead of having to know the customer info.


Currently they would open the Customers form which then as a subform IF the customer has any quotes, it will list the quotes in the subform.

From there they can double-click on the QuoteID in the subform or click on a button to enter a brand new quote from the Customers form footer section.

Anyway, it's on the Double-click procedure that links the information together as see in the code listed above to open the related to the QuoteID AND CustomerID IF and only IF opened from the Customers form and the subform.


Again, the ByQuote form is independent. No other forms are open. We need to have the Quote form open with the related QuoteID only from this form on the double-click.

So the Quote form has the OnActivate code (as listed above).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top