I have a button on a form which on clicking runs this code.
Everything runs fine except the line;
DoCmd.OpenQuery "qryProductByType".
In this query is the criteria GetProdType().
The error message is Run time error 3270 Property not found. Is the problem with the Function GetProdType() procedure?
thanks
Everything runs fine except the line;
DoCmd.OpenQuery "qryProductByType".
In this query is the criteria GetProdType().
The error message is Run time error 3270 Property not found. Is the problem with the Function GetProdType() procedure?
thanks
Code:
Option Compare Database
Option Explicit
Public gIntProdType As Integer
Private Sub cmdInboundTransport_Click()
Dim iProductType As Integer
On Error GoTo cmdInboundTransport_Err
Dim intProdType As Integer
intProdType = 1
SetProdType (intProdType)
DoCmd.OpenQuery "qryProductByType"
cmdInboundTransport_Exit:
Exit Sub
cmdInboundTransport_Err:
MsgBox Error$
Resume cmdInboundTransport_Exit
End Sub
Sub SetProdType(intProdType As Integer)
' Set the public variable to be the value passed in.
gIntProdType = intProdType
End Sub
Function GetProdType()
' Return the value of the module variable.
GetProdType() = gIntProdType
End Function