Hi
Sorry to keep asking questions but I keep getting a run-time error 2001 "you canceled the previous operation" error whenever the code in the Dlookup line is reached. I have a table called Alphabet_lookup that I'm simply trying to extract a letter from depending on the value of counter . I first thought that "Letter" might be a reserved word so I changed the field name and still get the same error.
It's frustrating spending an entire afternoon on something like this. Thanks for any help.
Splits = Val([Forms]![Splits_Form]![Number_of_Splits_Textbox])
COUNTER = 1
Dim ltr As String
Do
Do While COUNTER <= Splits
ltr = DLookup("[LETTER]", "Alphabet_lookup", "[split_num] = Counter")
Set db = CurrentDb
Set rs = db.OpenRecordset("Count_Stations")
rs.AddNew
rs("PCID") = DMax("[PCID]", "Count_Stations") + 1
rs("Counting_S") = Forms!count_stations_form!COUNTING_S & ltr & "-" & get_global("g_group")
rs("Street") = Forms!count_stations_form!STREET
rs("Cross_St1") = Forms!count_stations_form!CROSS_ST1
rs("Cross_St2") = Forms!count_stations_form!CROSS_ST2
rs("Cnty_fips") = Forms!count_stations_form!CNTY_FIPS
rs("Status") = "add/split"
rs("Action_Note") = "ADD:as per SPLIT"
rs("Creation_date") = Date
rs.Update
rs.Close
If COUNTER = Splits Then
done = yes
Exit Do
End If
COUNTER = COUNTER + 1
Loop
Loop Until done = yes