my codings gotten little too complicated...
i don't get why the first if statement is not working..
it seems like other ones are looping fine...
Private Sub chkActual_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim lresponse As Integer
DoCmd.RunCommand acCmdSaveRecord
If Me.BudgetKey = Null Then
MsgBox "you must approve your requisition before you can select an actual amount"
Me.chkActual = False
Me.chkEST = True
Exit Sub
'above line is not working..
End If
If Me.chkActual = True Then
Me.chkEST = False
lresponse = MsgBox("Have you entered the actual amount?", vbYesNo, "Continue")
If lresponse = vbYes Then
'only one check box available
Me.chkActual = True
Set db = CurrentDb()
Set rs = db.OpenRecordset("tbl_vregister", dbOpenDynaset)
rs.AddNew
rs![PrNum] = Me![txtPR]
rs.Update
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
DoCmd.SetWarnings False
DoCmd.OpenQuery "uQry_PRtoVR"
DoCmd.SetWarnings True
Me.chkEST = False
End If
If lresponse = vbNo Then
Me.Amount.SetFocus
Me.chkActual = False
Me.chkEST = True
End If
End If
End Sub
so the system is suppose to check and see if there is a value in "me.budgetkey" field box. If null then they can not proceed. If budgetkey is already assigned (dlookup on page load), then rs.edit
i know i have very bad codings but.. what am i doing wrong?
i don't get why the first if statement is not working..
it seems like other ones are looping fine...
Private Sub chkActual_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim lresponse As Integer
DoCmd.RunCommand acCmdSaveRecord
If Me.BudgetKey = Null Then
MsgBox "you must approve your requisition before you can select an actual amount"
Me.chkActual = False
Me.chkEST = True
Exit Sub
'above line is not working..
End If
If Me.chkActual = True Then
Me.chkEST = False
lresponse = MsgBox("Have you entered the actual amount?", vbYesNo, "Continue")
If lresponse = vbYes Then
'only one check box available
Me.chkActual = True
Set db = CurrentDb()
Set rs = db.OpenRecordset("tbl_vregister", dbOpenDynaset)
rs.AddNew
rs![PrNum] = Me![txtPR]
rs.Update
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
DoCmd.SetWarnings False
DoCmd.OpenQuery "uQry_PRtoVR"
DoCmd.SetWarnings True
Me.chkEST = False
End If
If lresponse = vbNo Then
Me.Amount.SetFocus
Me.chkActual = False
Me.chkEST = True
End If
End If
End Sub
so the system is suppose to check and see if there is a value in "me.budgetkey" field box. If null then they can not proceed. If budgetkey is already assigned (dlookup on page load), then rs.edit
i know i have very bad codings but.. what am i doing wrong?