dinkytrouble
Technical User
Hi, I am new to the forum so i appologise if this has gont to the wrong section. i have a problem i hope someone will be able to help me with.
my database usually has Option Compare Database. I have re wrote most of my code to compensate to go to option explicit but now i face a problem that it will not allow me to use the case duplicate that has previously worked. here is my code if someone could please tell me why the select duplicate section will no longer work this would be great.
i cannot find this anywhere on the web.
Private Sub Command59_Click()
If (Forms![dry data]!Text62 < 40) And (Eval("[Forms]![dry data]![LOW YIELD REASON] Is Null")) Then
Beep
MsgBox "YOU MUST PUT A REASON FOR THE LOW YIELD", vbOKOnly, ""
[Forms]![dry data]![low yield reason].SetFocus
Exit Sub
End If
Dim LResponse As Integer
LResponse = MsgBox("Do you wish to release this lot to dry inspection?", vbYesNo, "Continue")
If LResponse = vbYes Then
MSG = "Lot Released !!" ' and take appropriate
Dim temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8, TEMP9, TEMP10 As String
temp2 = [CAVITY]
temp3 = [pldcavity]
temp4 = [POWER]
temp5 = [MAIN PLD]
temp6 = [Balance]
temp8 = [Oven]
TEMP9 = [fit]
Dim MyDB As Database, MyTable As Recordset
Set MyDB = DBEngine.Workspaces(0).Databases(0)
Set MyTable = MyDB.OpenRecordset("dry inspection", DB_OPEN_TABLE)
On Error Resume Next ' Set up error handler.
MyTable.AddNew
MyTable("CAVITY") = temp2
MyTable("PLDCAVITY") = temp3
MyTable("target POWER") = temp4
MyTable("main pld") = temp5
MyTable("dry inspection starts") = temp6
MyTable("oven") = temp8
MyTable("FIT") = TEMP9
MyTable.Update
MsgBox "released"
DoCmd.Close
Select Case Err
Case DUPLICATE
MsgBox "This Lot Has Already Been Released To Dry Ispection please consult your team leader !!", , "Status Report.."
Response = DATA_ERRCONTINUE
End Select
Err = 0 '' Clear error.
MyTable.Move 0, MyTable.LastModified
MyTable.Close
Else ' action.
MsgBox "This Lot Has Not Been Released To Dry Inspection !!", , "Status Report.."
End If
End Sub
many thanks
dinky trouble
my database usually has Option Compare Database. I have re wrote most of my code to compensate to go to option explicit but now i face a problem that it will not allow me to use the case duplicate that has previously worked. here is my code if someone could please tell me why the select duplicate section will no longer work this would be great.
i cannot find this anywhere on the web.
Private Sub Command59_Click()
If (Forms![dry data]!Text62 < 40) And (Eval("[Forms]![dry data]![LOW YIELD REASON] Is Null")) Then
Beep
MsgBox "YOU MUST PUT A REASON FOR THE LOW YIELD", vbOKOnly, ""
[Forms]![dry data]![low yield reason].SetFocus
Exit Sub
End If
Dim LResponse As Integer
LResponse = MsgBox("Do you wish to release this lot to dry inspection?", vbYesNo, "Continue")
If LResponse = vbYes Then
MSG = "Lot Released !!" ' and take appropriate
Dim temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8, TEMP9, TEMP10 As String
temp2 = [CAVITY]
temp3 = [pldcavity]
temp4 = [POWER]
temp5 = [MAIN PLD]
temp6 = [Balance]
temp8 = [Oven]
TEMP9 = [fit]
Dim MyDB As Database, MyTable As Recordset
Set MyDB = DBEngine.Workspaces(0).Databases(0)
Set MyTable = MyDB.OpenRecordset("dry inspection", DB_OPEN_TABLE)
On Error Resume Next ' Set up error handler.
MyTable.AddNew
MyTable("CAVITY") = temp2
MyTable("PLDCAVITY") = temp3
MyTable("target POWER") = temp4
MyTable("main pld") = temp5
MyTable("dry inspection starts") = temp6
MyTable("oven") = temp8
MyTable("FIT") = TEMP9
MyTable.Update
MsgBox "released"
DoCmd.Close
Select Case Err
Case DUPLICATE
MsgBox "This Lot Has Already Been Released To Dry Ispection please consult your team leader !!", , "Status Report.."
Response = DATA_ERRCONTINUE
End Select
Err = 0 '' Clear error.
MyTable.Move 0, MyTable.LastModified
MyTable.Close
Else ' action.
MsgBox "This Lot Has Not Been Released To Dry Inspection !!", , "Status Report.."
End If
End Sub
many thanks
dinky trouble