I am having two forms OrderForm and CustomerForm.
In CustomerForm, I have a combo box, in which I select the orderId. If I click 'View' button , then it should show me a pop up which contains the order details of THIS 'orderId'
CustomerForm
- orderId stored in cbxOrderId
- viewOrderBut - button to display orderForm popup
I tried like below and failed
viewOrderBut click event
Forms![OrderForm].orderId = orderIdVar
Error:
Cannot find the referenced Form 'OrderForm'
my orderId variable in OrderForm is public
public orderId as string
Someone Please help me.
Editing
Code :
CustomerForm :
Public gblorderId as string
Private Sub btnApproval_Click()
gblOrderId = "123" 'static assignment of order id
DoCmd.OpenForm "OrderForm"
End Sub
OrderForm
Public orderId as string
Private Sub Form_Load()
orderId = gblOrderID
MsgBox("orderId="+orderId)
End sub
Error:
Prints...
orderId=
how to refer to CustomerForm.gblOrderId from OrderForm. I guess there i am missing.