aromano789
Registered User.
- Local time
- Today, 09:08
- Joined
- Feb 9, 2008
- Messages
- 12
New to ADP
I use this module in access 2003 and 2007 in mdb format. When i try and use it in ADP i get "Object variable or with variable not set"
Can someone point me in the right direction
Thanks
________________________________________________
Function test()
'This function looks at the input file. start number, end number and street name.
'It then creates a record in the output file for every street number in between the
'start number and end number (TONY)
'
Dim rstInput As DAO.Recordset
Dim rstOutput As DAO.Recordset
Dim i As Integer
Set rstInput = CurrentDb.OpenRecordset("tblInput") <---- get error here
Set rstOutput = CurrentDb.OpenRecordset("tblOutput")
Do Until rstInput.EOF
For i = rstInput!StartNum To rstInput!endNum
rstOutput.AddNew
rstOutput!StreetNumber = i
rstOutput!Streetname = rstInput!Streetname
rstOutput.Update
Next i
rstInput.MoveNext
Loop
rstInput.Close
rstOutput.Close
CurrentDb.Close
End Function
___________________________________________________
I use this module in access 2003 and 2007 in mdb format. When i try and use it in ADP i get "Object variable or with variable not set"
Can someone point me in the right direction
Thanks
________________________________________________
Function test()
'This function looks at the input file. start number, end number and street name.
'It then creates a record in the output file for every street number in between the
'start number and end number (TONY)
'
Dim rstInput As DAO.Recordset
Dim rstOutput As DAO.Recordset
Dim i As Integer
Set rstInput = CurrentDb.OpenRecordset("tblInput") <---- get error here
Set rstOutput = CurrentDb.OpenRecordset("tblOutput")
Do Until rstInput.EOF
For i = rstInput!StartNum To rstInput!endNum
rstOutput.AddNew
rstOutput!StreetNumber = i
rstOutput!Streetname = rstInput!Streetname
rstOutput.Update
Next i
rstInput.MoveNext
Loop
rstInput.Close
rstOutput.Close
CurrentDb.Close
End Function
___________________________________________________