Open Related Form When Click Field

scouser

Registered User.
Local time
Today, 19:34
Joined
Nov 25, 2003
Messages
767
Hi. I would like to open Form B when a field is clicked in Form A.

Form A = frmCustomerOrderHistory1 (OrderID)
Form B = frmSalesOrders

When user clicks OrderHistory (OrderID) I would like frmSalesOrders to open displaying the corresponding Order.

I have tried:

DoCmd.OpenForm frmSalesOrders, acNormal, [Forms]![frmCustomerOrderHistory1]![OrderID] = [Forms]![frmSalesOrders]![OrderID], , acFormEdit, acWindowNormal

Any help much appreciated.
Phil.
 
the 1st part of the where clause is the field,
the 2nd is the textbox on the form. no need for the full path, since you are already in the form.

DoCmd.OpenForm frmSalesOrders, acNormal, "[OrderID] = " & txtOrderID
 
OK, I have resolved.

DoCmd.OpenForm "frmSalesOrders", , , "OrderID = " & OrderID.Value
Phil.
 
Hi. Just seen your post, that was quick! I managed resolve in the meantime. Thanks.
Phil.
 
try

DoCmd.OpenForm "frmSalesOrders",,, "[OrderID] = " & [OrderID], , acFormEdit, acWindowNormal
 

Users who are viewing this thread

Back
Top Bottom