I have an old Access database that's been upgraded to 2010 (it was originally written, not by me, back in the mid-late 1990s). The original developer used a lot of unbound controls in his forms that he populated from combos. This problem will probably come back in other parts of this database but right now I need to fix this part and I can't find a good answer for how to go about it. Anyway, the problem:
The unbound control "Posted Items" gets populated by a combo box. When the user wants to edit one of the posted items, she clicks on the one she wants to edit and it's supposed to feed the necessary parameters to the edit form so it opens up the correct posted item. It is failing at this because it's not successfully obtaining the parameters from the form to send to this bit of code:
Code:
Private Sub Posted_items_Click()
Dim stDocName As String
Dim stLinkCriteria As String
Dim cnt As Integer
Dim postnum, linenum
For cnt = 0 To [Posted items].ListCount
If Form![Posted items].Value = Form![Posted items].Column(0, cnt) Then
postnum = Form![Posted items].Column(1, cnt)
linenum = Form![Posted items].Column(0, cnt)
End If
Next
stDocName = "cshlin edit"
' Forms![Edit Posts]![Posted items]
stLinkCriteria = "[num]='" & postnum & "' AND [ln#]=" & linenum
DoCmd.OpenForm stDocName, acNormal, , stLinkCriteria, acFormEdit
End Sub
If there's a reference I need to put in, please tell me exactly what it's named. There are not MISSING references in the library at this point. I'm guessing that something's changed in how forms get references and that's why those fields are blank now. I have people unable to work and collections going uncollected while I'm trying to fix this in emergency mode. I appreciate any time you can give me to try and figure this out.