Hi all,
I am rewriting a database with Access 2002 that was originally written with Access 97. I get a "User-defined type not defined" error. Here's the code:
...
Private Sub cbxClient_AfterUpdate()
Dim strSQL As String, strRestrict As String
Dim v As Variant, lngX As Variant
Dim dbs As Database, rst As Recordset, fld As Field, fld2 As Field
lngX = Forms![frmCallMonitoring]![cbxClient].Value
' Return reference to current database.
Set dbs = CurrentDb
strSQL = "SELECT *"
strSQL = strSQL & " FROM [tblClientWeighting]"
strSQL = strSQL & " WHERE [tblClientWeighting].[Client] = '" & lngX & "'"
' Open table-type Recordset object.
Set rst = dbs.OpenRecordset(strSQL)
'Set fld = rst.Fields!Courtesy1wgt
Me![txtOpeningWgt11].Value = rst.Fields!txtOpeningWgt11.Value
...
I must be doing something wrong - where do I define this data type. I'm a Java programmer, but have to do this project for work, so my VBA skills are not really sharp. Please help!!!
Thank you in advance.
Clinton
"Finish what you started"
I am rewriting a database with Access 2002 that was originally written with Access 97. I get a "User-defined type not defined" error. Here's the code:
...
Private Sub cbxClient_AfterUpdate()
Dim strSQL As String, strRestrict As String
Dim v As Variant, lngX As Variant
Dim dbs As Database, rst As Recordset, fld As Field, fld2 As Field
lngX = Forms![frmCallMonitoring]![cbxClient].Value
' Return reference to current database.
Set dbs = CurrentDb
strSQL = "SELECT *"
strSQL = strSQL & " FROM [tblClientWeighting]"
strSQL = strSQL & " WHERE [tblClientWeighting].[Client] = '" & lngX & "'"
' Open table-type Recordset object.
Set rst = dbs.OpenRecordset(strSQL)
'Set fld = rst.Fields!Courtesy1wgt
Me![txtOpeningWgt11].Value = rst.Fields!txtOpeningWgt11.Value
...
I must be doing something wrong - where do I define this data type. I'm a Java programmer, but have to do this project for work, so my VBA skills are not really sharp. Please help!!!
Thank you in advance.
Clinton
"Finish what you started"