I am young aspiring program, and I have not yet begun to tackle Visual Basic. However I have been assigned the task of updating a Microsoft Access database from the 1997 version to 2007. The Access program is not foreign to me, but Visual Basic and C++ are; and the current database I am working with has an extensive amount of outdated VB code i have to fix.
So far my tactic has been to debug/compile the code and the try to troubleshoot the problems with only the highlighted problematic text, and the error that occurred. This method worked for a short amount of time, but I eventual got stumped on a particular error and now here I am.
So here is the current code I am having trouble with:
Dim Db As Database, CFile As Table
Set Db = CurrentDb()
Set CFile = Db.OpenTable("Customers")
CFile.Index = "PrimaryKey"
Do Until CFile.EOF 'Run through all Customer Records
Temp3 = 0
If CFile![Monthly Charge] = 9 Then
Temp3 = 3
If CFile![Monthly Charge] = 11 Then
Temp3 = 6
If CFile![Monthly Charge] = 30 Then
Temp3 = 15
If CFile![Monthly Charge] = 32 Then
Temp3 = 13
CFile![Monthly Charge] = CFile![Monthly Charge] + Temp3
NewRates = Null
The error I am currently contending with is on the second line of code "Dim Db As Database, CFile As Table", where it is highlighting the ', CFile As Table' section and saying 'user defined type not defined' any help would be greatly appreciated.
Edited by Shamis25, 06 January 2011 - 10:34 AM.