RobertIngles
Technical User
Can anyone tell me what is wrong with my code? Clicking "Yes" when the msg box pops up doesn't open the specified form. What have I done wrong?
Private Sub Command4_Click()
'Create var.
Dim intChk As Integer
'This line counts the number of rec instances in TBLLaptop.
intChk = DCount("*", "tblLaptop", "Barcode = '" & Forms!QRYJustBarcodes!Barcode & "'")
'Does the rec exist? If not then open FRMCreateNewLaptopandUserV3 to add the new user details.
If intChk = 0 Then 'No?
MsgBox "This Laptop Does Not Exist, Do You Wish to Create Laptop Profile", vbYesNo + vbQuestion, "Create New Laptop Profile?"
If Response = vbYes Then
DoCmd.OpenForm "FRMCreateNewLaptopandUserV3", acNormal, , , acFormAdd
End If
End If
End Sub
Private Sub Command4_Click()
'Create var.
Dim intChk As Integer
'This line counts the number of rec instances in TBLLaptop.
intChk = DCount("*", "tblLaptop", "Barcode = '" & Forms!QRYJustBarcodes!Barcode & "'")
'Does the rec exist? If not then open FRMCreateNewLaptopandUserV3 to add the new user details.
If intChk = 0 Then 'No?
MsgBox "This Laptop Does Not Exist, Do You Wish to Create Laptop Profile", vbYesNo + vbQuestion, "Create New Laptop Profile?"
If Response = vbYes Then
DoCmd.OpenForm "FRMCreateNewLaptopandUserV3", acNormal, , , acFormAdd
End If
End If
End Sub