Hi all,
How do i create a variable that will be visible to all Forms after it is created?
At the top of my module I have:
My function is:
When an Order form loads I call my function with:
That sets the values and the Order form can see the values, however when I open another Form from my Order Form , the variable values come back empty or NULL.
What am I doing wrong?
Thanks
melt
How do i create a variable that will be visible to all Forms after it is created?
At the top of my module I have:
Code:
'globalvarable to hold the line-item count for each section on the order form
Global varHardware, varSupport, varEng As Integer
My function is:
Code:
Public Sub GetLineItemCount(OrderID As Integer)
On Error GoTo Error_Handler
'count the number of line-items in each section of the form
varHardware = DCount("[OrderID]", "OrderDetails", "[ProductID] IS NOT NULL AND [OrderID]=" & OrderID)
varSupport = DCount("[OrderID]", "OrderDetails2", "[OrderID]=" & OrderID & " AND [ServiceTypeID]=1")
varEng = DCount("[OrderID]", "OrderDetails2", "[OrderID]=" & OrderID & " AND [ServiceTypeID]=2")
Exit_Handler_Click:
Exit Sub
Error_Handler:
MsgBox Err.Description
Resume Exit_Handler_Click
End Sub
When an Order form loads I call my function with:
Code:
' get the line-item count for each section - Module 1
Call GetLineItemCount(Me.OpenArgs)
That sets the values and the Order form can see the values, however when I open another Form from my Order Form , the variable values come back empty or NULL.
What am I doing wrong?
Thanks
melt