G
gw
We have a simple application developed in Acees 95 / upgraded to 97 and now
we wish to move to 2000. the application 'almost' upgrades itself apart from
a problem we are havinng with OpenRecordSet .
The code is simple and I know (with hindsight) it can be much neater but
when you do not spend a great deal of time and it works then leave alone.
Code throws up Run Time eror 13 at the OpenRecordset command when run. Have
read lots of docs but confused as to change this seems a major problem. Have
checked DAO 3.6 to get round other problems and they seem to work.
Help appreciated
Public Function check_cust_number()
Dim no_string As String * 4
Dim iRec_count As Long
DoCmd.OpenQuery "sales_ledger_by_account_ref"
Set mydb = CurrentDb
Set Imp_table = mydb.OpenRecordset("sales_ledger_by_account_ref") ****
error line
Do Until Imp_table.EOF
iRec_count = 1
If Forms![job_log]![cust_number] = Imp_table("ACCOUNT_REF") Then Exit Do
Imp_table.MoveNext
iRec_count = 2
Loop
If iRec_count = 1 Then
Forms![job_log]![cust_name] = Imp_table("NAME")
Forms![job_log]![deliv_name] = Imp_table("NAME")
If Imp_table("ADDRESS_1") <> "" Then Forms![job_log]![deliv_address_1] =
Imp_table("ADDRESS_1")
we wish to move to 2000. the application 'almost' upgrades itself apart from
a problem we are havinng with OpenRecordSet .
The code is simple and I know (with hindsight) it can be much neater but
when you do not spend a great deal of time and it works then leave alone.
Code throws up Run Time eror 13 at the OpenRecordset command when run. Have
read lots of docs but confused as to change this seems a major problem. Have
checked DAO 3.6 to get round other problems and they seem to work.
Help appreciated
Public Function check_cust_number()
Dim no_string As String * 4
Dim iRec_count As Long
DoCmd.OpenQuery "sales_ledger_by_account_ref"
Set mydb = CurrentDb
Set Imp_table = mydb.OpenRecordset("sales_ledger_by_account_ref") ****
error line
Do Until Imp_table.EOF
iRec_count = 1
If Forms![job_log]![cust_number] = Imp_table("ACCOUNT_REF") Then Exit Do
Imp_table.MoveNext
iRec_count = 2
Loop
If iRec_count = 1 Then
Forms![job_log]![cust_name] = Imp_table("NAME")
Forms![job_log]![deliv_name] = Imp_table("NAME")
If Imp_table("ADDRESS_1") <> "" Then Forms![job_log]![deliv_address_1] =
Imp_table("ADDRESS_1")