maggiemuffins
Programmer
Hi there - I am fairly new to VBA. I am building an Access DB for work and have hit a brick wall.
On one form (Departmental Approval) there is a Combo Box with a value list of Departments, and below that a button that opens a second Form (Item Entry Form), filtered to show the records pertaining to the chosen Department.
The problem I have is,I want it to show ONLY the records that have not been Approved. To show approval there is a check box that must be "checked" - and I only want to show those that have an "unchecked" box.
Here is the basic code to open the linked forms:
Private Sub open_approval_button_Click()
On Error GoTo Err_open_approval_button_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Item Entry Form"
stLinkCriteria = "[Resp_Dept]=" & "'" & Me![Dept] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_open_approval_button_Click:
Exit Sub
Err_open_approval_button_Click:
MsgBox Err.Description
Resume Exit_open_approval_button_Click
End Sub
I am not sure where I would add code to filter the records further...
I have the feeling I am going about this all the wrong way -
any advice would be appreciated.
Thanks
On one form (Departmental Approval) there is a Combo Box with a value list of Departments, and below that a button that opens a second Form (Item Entry Form), filtered to show the records pertaining to the chosen Department.
The problem I have is,I want it to show ONLY the records that have not been Approved. To show approval there is a check box that must be "checked" - and I only want to show those that have an "unchecked" box.
Here is the basic code to open the linked forms:
Private Sub open_approval_button_Click()
On Error GoTo Err_open_approval_button_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Item Entry Form"
stLinkCriteria = "[Resp_Dept]=" & "'" & Me![Dept] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_open_approval_button_Click:
Exit Sub
Err_open_approval_button_Click:
MsgBox Err.Description
Resume Exit_open_approval_button_Click
End Sub
I am not sure where I would add code to filter the records further...
I have the feeling I am going about this all the wrong way -
any advice would be appreciated.
Thanks