Updating database

  • Thread starter Thread starter LW Irving
  • Start date Start date
L

LW Irving

I am updating an access data base from 97 to 2002. I have a form that has a
little modules that generates a quote number based on the month number plus
a number form 0-999, in the updated DB it throws an error that says
myset.
the method or data value not found

Private Sub GetQuoteNo()
'** 16/2/00 - code revised for y2k fix - JW

Dim MyDB As Database, MySet As Recordset, MyQuery As QueryDef
Dim Next_Quote As Variant
Dim Temp As String

Next_Quote = CheckMonthChange()

If Next_Quote = "True" Then
Set MyDB = CurrentDb


Set MySet = MyDB.OpenRecordset("SELECT TOP 1 QUOTE FROM QUOTES WHERE
(Quote Like '" _
& Left(gblOffPrefix, 1) & "0*') ORDER BY QUOTE DESC")
Next_Quote = CStr(CInt(Right(MySet.
, 3)) + 1) '** increment quote
number
Select Case Len(Next_Quote)
Case 1
Temp = "00" & Next_Quote
Case 2
Temp = "0" & Next_Quote
Case Else
Temp = Next_Quote
End Select
Temp = Left(MySet.
, 5) & Trim(Temp)
MySet.Close
Forms![InputNewQuote].
.Enabled = True
Forms![InputNewQuote].
.Locked = False
Forms![InputNewQuote].
= Temp
Forms![InputNewQuote].
.Enabled = False
Forms![InputNewQuote].
.Locked = True
.BackColor = 12632256
.TabStop = False
.BorderStyle = 0
Else
Temp = Next_Quote
End If
Forms![InputNewQuote]!
= Temp
MsgBox "New quote number is " & Temp, vbInformation, "New Quote"
 
LW said:
I am updating an access data base from 97 to 2002. I have a form that has a
little modules that generates a quote number based on the month number plus
a number form 0-999, in the updated DB it throws an error that says
myset.
the method or data value not found []
Set MySet = MyDB.OpenRecordset("SELECT TOP 1 QUOTE FROM QUOTES WHERE
(Quote Like '" _
& Left(gblOffPrefix, 1) & "0*') ORDER BY QUOTE DESC")
Next_Quote = CStr(CInt(Right(MySet.
, 3)) + 1) '** increment quote
[]

I'm surprise that syntax ever worked, it's should be a bang
instead of a dot:

Next_Quote = CStr(CInt(Right(MySet!
, 3)) + 1)
Temp = Left(MySet!
, 5) & Trim(Temp)
 
Back
Top