G
Guest
I'm trying to write a query using codes, but I keep getting this message on
declaring my Database:
Compile error:
User-defined type not defined.
Here's what I have written:
Private Sub cboPOKey_AfterUpdate()
Dim D As Database
Dim rsInfo As Recordset
Dim strSQL As String
Set D = CurrentDb
PODetail.POUnitPrice, PODetail.QuantityRecived, "strSQL = "SELECT
PODetail.PODetail_PKey, PODetail.PONumber, PODetail.POLine FROM PODetail
WHERE"
strSQL = strSQL & "[PODetail.PODetail_PKey] = '" & Me!cboPOKey & "'"
Set rsInfo = D.Openrecordset(strSQL, DB_OPEN_DYNASET)
Me!tabInfo.Pages(1).SetFocus
Me!txtPOKey = rsInfo("PODetail_PKey")
Me!txtPONum = rsInfo("PONumber")
Me!txtPOLine = rsInfo("POLine")
rsInfo.Close
I checked with Access' internal help support and that's what the example
said to use. Have I missed anything? I've been testing this for the last 2
days! Can somebody help me? Thanks in advance.
declaring my Database:
Compile error:
User-defined type not defined.
Here's what I have written:
Private Sub cboPOKey_AfterUpdate()
Dim D As Database
Dim rsInfo As Recordset
Dim strSQL As String
Set D = CurrentDb
PODetail.POUnitPrice, PODetail.QuantityRecived, "strSQL = "SELECT
PODetail.PODetail_PKey, PODetail.PONumber, PODetail.POLine FROM PODetail
WHERE"
strSQL = strSQL & "[PODetail.PODetail_PKey] = '" & Me!cboPOKey & "'"
Set rsInfo = D.Openrecordset(strSQL, DB_OPEN_DYNASET)
Me!tabInfo.Pages(1).SetFocus
Me!txtPOKey = rsInfo("PODetail_PKey")
Me!txtPONum = rsInfo("PONumber")
Me!txtPOLine = rsInfo("POLine")
rsInfo.Close
I checked with Access' internal help support and that's what the example
said to use. Have I missed anything? I've been testing this for the last 2
days! Can somebody help me? Thanks in advance.